Updated on 2025-06-07 GMT+08:00

U0520004: The maximum sizes of data types related to SQL Server and PostgreSQL are incompatible

Description

Database Type and Version

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

Syntax Example

After conversion, the maximum size of some data types in PostgreSQL is incompatible with that of the original data types in SQL Server. For example, VARCHAR (MAX) in SQL Server supports a maximum of 2 GB of storage, but PostgreSQL supports only 1 GB even if TEXT is used. UGO will convert the data type and report a risk message. For example:

SQL Server syntax:

CREATE TABLE tab (c1 VARCHAR(MAX));
Figure 1 Handling the VARCHAR(MAX) data type in SQL Server on UGO

Suggestion

Evaluate whether the data type restrictions meet service requirements.