From:       To:      
Home > Documentation > PostgreSQL to SQL Server

PostgreSQL to SQL Server Types Mapping

[Postgres to SQL Server Converter]  [About Migration]  [FAQ

Although PostgreSQL and SQL Server have similar data types, those sets are not absolutly equal. When migrating from PostgreSQL to Microsoft SQL it is necessary to map data types accordng to the table below:

PostgreSQL SQL Server
BIGINT BIGINT
BIGSERIAL BIGINT IDENTITY
BOOLEAN BIT
BYTEA VARBINARY(max)
CHAR(n), CHARACTER(n) CHAR(n), CHARACTER(n)
DATE DATE
DECIMAL(p,s), DEC(p,s) DECIMAL(p,s), DEC(p,s)
DOUBLE PRECISION DOUBLE PRECISION
FLOAT(p) FLOAT(p)
INT, INTEGER INT, INTEGER
MONEY MONEY
NUMERIC(p,s) NUMERIC(p,s)
REAL REAL
SERIAL INT IDENTITY
SMALLINT SMALLINT
TEXT VARCHAR(max)
TIME(p) TIME(p)
TIMESTAMP(3) DATETIME
TIMESTAMP(p) DATETIME2(p)
TIMESTAMP(p) WITH TIME ZONE DATETIMEOFFSET(p)
TINYINT SMALLINT
UUID UNIQUEIDENTIFIER
VARCHAR(n) VARCHAR(n)
XML XML