Data Type Definition
Keyword1
|
PostgreSQL Data Type
|
Description
|
Data Type Returned
|
---|---|---|---|
BIGINT
|
BIGINT
|
Large signed, exact
whole number. OR Signed eight-byte integer.
|
BIGINT
|
BIGSERIAL
|
Autoincrementing eight-byte
integer.
|
||
BIT(n)
|
Fixed-length bit string.
|
||
BIT VARYING(n)
|
Variable-length bit
string.
|
||
BOOLEAN
|
Logical Boolean (true/false).
|
||
BOX
|
Rectangular box on a
plane.
|
||
BYTEA
|
Binary data (byte array).
|
||
CHAR(n)
|
CHAR(n)
|
Fixed-length character
string.
|
CHAR(n)
|
CIDR
|
IPv4 or IPv6 network
address.
|
||
CIRCLE
|
Circle on a plane.
|
||
DATE
|
DATE
|
Date value.
|
DATE
|
DECIMAL|NUMERIC(p,s)
|
NUMERIC(p,s)
|
Signed, fixed-point
decimal number.
|
DECIMAL|NUMERIC(p,s)
|
DOUBLE
|
DOUBLE PRECISION
|
Signed, double precision,
floating-point number.
|
DOUBLE
|
FLOAT(p)
|
FLOAT(p)
|
Signed, single precision
or double precision, floating-point number.
|
FLOAT(p)
|
INET
|
IPv4 or IPv6 host address.
|
||
INTEGER
|
INTEGER
|
Regular signed, exact
whole number.
|
INTEGER
|
INTERVAL
|
Time span.
|
||
LINE
|
Infinite line on a plane.
|
||
LSEG
|
Line segment on a plane.
|
||
MACADDR
|
Media Access Control
address.
|
||
MONEY
|
Currency amount.
|
||
PATH
|
Geometric path on a
plane.
|
||
POINT
|
Geometric point on a
plane.
|
||
POLYGON
|
Closed geometric path
on a plane.
|
||
REAL
|
REAL
|
Signed, single precision
floating-point number.
|
REAL
|
SERIAL
|
Autoincrementing four-byte
integer.
|
||
SMALLINT
|
SMALLINT
|
Small signed, exact
whole number.
|
SMALLINT
|
SMALL SERIAL
|
Autoincrementing two-byte
integer.
|
||
TEXT
|
Variable-length character
string.
|
||
TIME(p)
|
TIME(p)
|
Time value.
|
TIME(p)
|
TIMESTAMP(p)
|
TIMESTAMP(p)
|
Date and time value.
|
TIMESTAMP(p)
|
TSQUERY
|
Text search query.
|
||
TSVECTOR
|
Text search document.
|
||
TXID_SNAPSHOT
|
User-level transaction
ID snapshot.
|
||
UUID
|
Universally unique identifier.
|
||
VARCHAR(n)
|
CHARACTER VARYING(n)
|
Varying-length character
string.
|
VARCHAR(n)
|
XML
|
XML data.
|
||
1The CT_PRESERVE= connection argument, which controls how data types are mapped, can affect whether a data type can be defined. The values FORCE (default) and FORCE_COL_SIZE do not affect whether a data type can be defined. The values STRICT and SAFE can result in an error if the requested data type is not native to the data source, or the specified precision or scale is not within the data source range. | |||
2The PostgreSQL data type cannot be defined, and when data is retrieved, the native data type is mapped to a similar data type. |