In SQL Server, DATETIME2(p) data type stores date and time with fractional seconds. In PostgreSQL, you can use TIMESTAMP(p) data type.
SQL Server:
-- Sample table with DATETIME2 with milliseconds accuracy CREATE TABLE specs ( item VARCHAR(30), created_dt DATETIME2(3) );
PostgreSQL:
-- Sample table with TIMESTAMP with milliseconds accuracy CREATE TABLE specs ( item VARCHAR(30), created_dt TIMESTAMP(3) );
Conversion summary:
For more information, see SQL Server to PostgreSQL Migration.