Help Center/ Database and Application Migration UGO/ User Guide/ Syntax Conversion/ Conversion Error Codes/ Error Codes Generated During Conversion from SQL Server to PostgreSQL/ U0520002: PostgreSQL does not support the time data type. If the decimal second precision exceeds 6, the time precision is lost
Updated on 2025-06-07 GMT+08:00

U0520002: PostgreSQL does not support the time data type. If the decimal second precision exceeds 6, the time precision is lost

Description

Database Type and Version

  • Source database type and version: all SQL Server versions
  • Target database type and version: all PostgreSQL versions

Syntax Example

In SQL Server, the time precision of data types such as DATETIME2, DATETIMEOFFSET, and TIME can be up to seven decimal places in seconds. In PostgreSQL, the maximum decimal second precision is 6. When converting related SQL statements, UGO displays the precision difference. For example:

SQL Server syntax:

CREATE TABLE tab(c1 DATETIME2, c2 DATETIMEOFFSET, c3 TIME);
Figure 1 Handling the precision of the time data type in SQL Server on UGO

Suggestion

Check whether the precision of the time data type in PostgreSQL meets service requirements.