diff --git a/src/test/regress/expected/generated_identity.out b/src/test/regress/expected/generated_identity.out index bf5e5248d..6500baf57 100644 --- a/src/test/regress/expected/generated_identity.out +++ b/src/test/regress/expected/generated_identity.out @@ -1,4 +1,11 @@ -- This test file has an alternative output because of error messages vary for PG13 +SHOW server_version \gset +SELECT substring(:'server_version', '\d+')::int <= 13 AS server_version_le_13; + server_version_le_13 +--------------------------------------------------------------------- + f +(1 row) + CREATE SCHEMA generated_identities; SET search_path TO generated_identities; SET client_min_messages to ERROR; @@ -313,10 +320,10 @@ INSERT INTO color(color_name) VALUES ('Blue'); \c - postgres - :master_port SET search_path TO generated_identities; SET client_min_messages to ERROR; -SET citus.next_shard_id TO 1270000; +SET citus.next_shard_id TO 12400000; DROP TABLE Color; CREATE TABLE color ( - color_id BIGINT GENERATED ALWAYS AS IDENTITY, + color_id BIGINT GENERATED ALWAYS AS IDENTITY UNIQUE, color_name VARCHAR NOT NULL ) USING columnar; SELECT create_distributed_table('color', 'color_id'); @@ -360,7 +367,7 @@ ERROR: cannot insert a non-DEFAULT value into column "color_id" DETAIL: Column "color_id" is an identity column defined as GENERATED ALWAYS. HINT: Use OVERRIDING SYSTEM VALUE to override. INSERT INTO color(color_id, color_name) OVERRIDING SYSTEM VALUE VALUES (1, 'Red'); -ERROR: duplicate key value violates unique constraint "color_color_id_key_102033" +ERROR: duplicate key value violates unique constraint "color_color_id_key_12400000" DETAIL: Key (color_id)=(1) already exists. CONTEXT: while executing command on localhost:xxxxx -- update null or custom value @@ -389,7 +396,7 @@ ERROR: cannot insert a non-DEFAULT value into column "color_id" DETAIL: Column "color_id" is an identity column defined as GENERATED ALWAYS. HINT: Use OVERRIDING SYSTEM VALUE to override. INSERT INTO color(color_id, color_name) OVERRIDING SYSTEM VALUE VALUES (1, 'Red'); -ERROR: duplicate key value violates unique constraint "color_color_id_key_102033" +ERROR: duplicate key value violates unique constraint "color_color_id_key_12400000" DETAIL: Key (color_id)=(1) already exists. CONTEXT: while executing command on localhost:xxxxx -- update null or custom value diff --git a/src/test/regress/expected/generated_identity_0.out b/src/test/regress/expected/generated_identity_0.out index 7aae21f20..87e831eea 100644 --- a/src/test/regress/expected/generated_identity_0.out +++ b/src/test/regress/expected/generated_identity_0.out @@ -1,4 +1,11 @@ -- This test file has an alternative output because of error messages vary for PG13 +SHOW server_version \gset +SELECT substring(:'server_version', '\d+')::int <= 13 AS server_version_le_13; + server_version_le_13 +--------------------------------------------------------------------- + t +(1 row) + CREATE SCHEMA generated_identities; SET search_path TO generated_identities; SET client_min_messages to ERROR; @@ -352,11 +359,11 @@ ALTER SEQUENCE color_color_id_seq RESTART WITH 1000; ERROR: Altering a distributed sequence is currently not supported. -- override system value INSERT INTO color(color_id, color_name) VALUES (1, 'Red'); -ERROR: cannot insert a non-DEFAULT value into column "color_id" +ERROR: cannot insert into column "color_id" DETAIL: Column "color_id" is an identity column defined as GENERATED ALWAYS. HINT: Use OVERRIDING SYSTEM VALUE to override. INSERT INTO color(color_id, color_name) VALUES (NULL, 'Red'); -ERROR: cannot insert a non-DEFAULT value into column "color_id" +ERROR: cannot insert into column "color_id" DETAIL: Column "color_id" is an identity column defined as GENERATED ALWAYS. HINT: Use OVERRIDING SYSTEM VALUE to override. INSERT INTO color(color_id, color_name) OVERRIDING SYSTEM VALUE VALUES (1, 'Red'); @@ -381,11 +388,11 @@ ALTER SEQUENCE color_color_id_seq RESTART WITH 1000; ERROR: Altering a distributed sequence is currently not supported. -- override system value INSERT INTO color(color_id, color_name) VALUES (1, 'Red'); -ERROR: cannot insert a non-DEFAULT value into column "color_id" +ERROR: cannot insert into column "color_id" DETAIL: Column "color_id" is an identity column defined as GENERATED ALWAYS. HINT: Use OVERRIDING SYSTEM VALUE to override. INSERT INTO color(color_id, color_name) VALUES (NULL, 'Red'); -ERROR: cannot insert a non-DEFAULT value into column "color_id" +ERROR: cannot insert into column "color_id" DETAIL: Column "color_id" is an identity column defined as GENERATED ALWAYS. HINT: Use OVERRIDING SYSTEM VALUE to override. INSERT INTO color(color_id, color_name) OVERRIDING SYSTEM VALUE VALUES (1, 'Red'); @@ -400,4 +407,4 @@ UPDATE color SET color_id = 1; ERROR: column "color_id" can only be updated to DEFAULT DETAIL: Column "color_id" is an identity column defined as GENERATED ALWAYS. DROP SCHEMA generated_identities CASCADE; -DROP USER identity_test_user; +DROP USER identity_test_user; \ No newline at end of file diff --git a/src/test/regress/sql/generated_identity.sql b/src/test/regress/sql/generated_identity.sql index 6bef6a147..c4181f3b5 100644 --- a/src/test/regress/sql/generated_identity.sql +++ b/src/test/regress/sql/generated_identity.sql @@ -1,4 +1,6 @@ -- This test file has an alternative output because of error messages vary for PG13 +SHOW server_version \gset +SELECT substring(:'server_version', '\d+')::int <= 13 AS server_version_le_13; CREATE SCHEMA generated_identities; SET search_path TO generated_identities;