Help Center/ Database and Application Migration UGO/ User Guide/ Syntax Conversion/ Conversion Error Codes/ Error Codes Generated During Conversion from GoldenDB to GaussDB/ U0700001: The restriction on distribution columns in RANGE/LIST partition tables in GaussDB is different from that in GoldenDB. In GaussDB, the primary or unique key must be a superset of a distribution key
Updated on 2025-06-07 GMT+08:00

U0700001: The restriction on distribution columns in RANGE/LIST partition tables in GaussDB is different from that in GoldenDB. In GaussDB, the primary or unique key must be a superset of a distribution key

Description

Database Type and Version

  • Source database type and version: GoldenDB 8.0
  • Target database type and version: GaussDB Distributed

Syntax Example

This error is reported because UGO converts the RANGE and LIST partition tables from GoldenDB to GaussDB Distributed by default.

In GaussDB Distributed, if a distribution key is explicitly specified for the RANGE or LIST partition table and the table contains a primary or unique key, the primary or unique key must be a superset of the distribution key. In the following example, the specified distribution key in the RANGE partition table is not a primary key column:
CREATE TABLE distributed_by_range_demo (
    year_col INT,
    col2 CHAR(5) NOT NULL PRIMARY KEY
) DISTRIBUTE BY RANGE(year_col) (
    SLICE g1 VALUES LESS THAN (1991),
    SLICE g2 VALUES LESS THAN (1995),
    SLICE g3 VALUES LESS THAN (MAXVALUE)
);

However, there is no requirement on the distribution key in GoldenDB. If the source statements do not meet this requirement, they must be refactored.

Suggestion

Modify Support for Range/List Distributed.