Help Center/ Database and Application Migration UGO/ User Guide/ Syntax Conversion/ Conversion Error Codes/ Error Codes Generated During Conversion from SQL Server to PostgreSQL/ U0520005: In SQL Server, a data type does not need to be specified for computed columns. In PostgreSQL, a data type must be specified for generated columns. Set the data type of computed columns
Updated on 2025-06-07 GMT+08:00

U0520005: In SQL Server, a data type does not need to be specified for computed columns. In PostgreSQL, a data type must be specified for generated columns. Set the data type of computed columns

Description

Database Type and Version

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

Syntax Example

In SQL Server, you do not need to specify a data type when declaring a computed column. In PostgreSQL 12 or later, you need to specify a data type when declaring a generated column. In a process except end-to-end migration, after UGO converts computed columns and prompts you to supplement the data type of generated columns. For example:

SQL Server syntax:

CREATE TABLE tab(id INT ,c1 INT, c2 AS 2*c1);
Figure 1 Handling SQL Server computed columns on UGO

Suggestion

Specify a data type for generated columns in the SQL statement after conversion.