IBM DB2 to PostgreSQL Types Mapping |
[DB2 to Postgres Converter] [About Migration] [Built-in Functions] |
IBM DB2 and PostgreSQL data types are not matched directly. Most of them are equal while others are not. When migrating database from DB2 to PostgreSQL it is important to take care about safe types mapping according to the table below:
IBM DB2 | PostgreSQL |
BIGINT | BIGINT |
BLOB(n) | BYTEA |
CHAR(n), CHARACTER(n) | CHAR(n) |
CHARACTER VARYING(n), VARCHAR(n) | VARCHAR(n) |
CLOB(n) | TEXT |
DATE | DATE |
DBCLOB(n) | TEXT |
DECFLOAT(16 | 34) | FLOAT |
DECIMAL(p,s) | DECIMAL(p,s) |
DOUBLE | DOUBLE PRECISION |
FLOAT(p) | DOUBLE PRECISION |
GRAPHIC(n) | CHAR(n) |
INTEGER | INTEGER |
NUMERIC(p,s) | NUMERIC(p,s) |
NCHAR(n) | CHAR(n |
NCHAR VARYING(n), NVARCHAR(n) | VARCHAR(n |
NVARCHAR(n) | VARCHAR(n) |
REAL | REAL |
SMALLINT | SMALLINT |
TIME | TIME(0) |
TIMESTAMP(p) | TIMESTAMP(p) |