skip to main content
Supported data types : PostgreSQL data types
 

Try DataDirect Cloud Now

PostgreSQL data types

The following table shows how the PostgreSQL data types are mapped to the standard data types for ODBC and JDBC.
Note: When the EnableWCharSupport connection parameter is set to true for the DataDirect Cloud Driver for ODBC, character types are mapped to the corresponding ODBC W-Types. For example, the varchar(max) type is mapped to the Unicode type SQL_WLONGVARCHAR.
Table 16. PostgreSQL data types
PostgreSQL data type
JDBC data type
ODBC data type
BIGINT
BIGINT
SQL_BIGINT(-5)
BIGSERIAL
BIGINT
SQL_BIGINT(-5)
BIT
BIT or BINARY
SQL_BIT(-7) or SQL_BINARY(-2)
BIT VARYING
BINARY
SQL_BINARY(-2)
BOOLEAN
BOOLEAN
SQL_BIT(-7)
BYTEA
LONGVARBINARY
SQL_LONGVARBINARY(4)
CHARACTER
CHAR
SQL_WCHAR(-8) or SQL_CHAR(1)
CHARACTER VARYING
VARCHAR
SQL_WVARCHAR(-9) or SQL_VARCHAR(12)
DATE
DATE
SQL_TYPE_DATE(91)
DOUBLE PRECISION
DOUBLE
SQL_DOUBLE(8)
INTEGER
INTEGER
SQL_INTEGER(4)
NUMERIC
NUMERIC
SQL_NUMERIC(2)
REAL
REAL
SQL_REAL(7)
SERIAL
INTEGER
SQL_INTEGER(4)
SMALLINT
SMALLINT
SQL_SMALLINT(5)
TEXT
LONGVARCHAR
SQL_WLONGVARCHAR(-10) or SQL_LONGVARCHAR(-1)
TIME
TIMESTAMP
SQL_TYPE_TIME(93)
TIME WITH TIMEZONE
TIMESTAMP
SQL_TYPE_TIMESTAMP(93)
TIMESTAMP
TIMESTAMP
SQL_TYPE_TIMESTAMP(93)
TIMESTAMP WITH TIMEZONE
TIMESTAMP
SQL_TYPE_TIMESTAMP(93)
XML
SQLXML
SQL_WLONGVARCHAR(-10) or SQL_LONGVARCHAR(-1)