Normalize unique key constraint errors for identity columns

issue/6694
Gokhan Gulbiz 2023-03-27 15:03:36 +03:00
parent b5e8ccac4c
commit f1b61aa7e2
No known key found for this signature in database
GPG Key ID: 608EF06B6BD1B45B
2 changed files with 5 additions and 2 deletions

View File

@ -307,3 +307,6 @@ s/(NOTICE: issuing SET LOCAL application_name TO 'citus_rebalancer gpid=)[0-9]+
# shard_rebalancer output, flaky improvement number # shard_rebalancer output, flaky improvement number
s/improvement of 0.1[0-9]* is lower/improvement of 0.1xxxxx is lower/g s/improvement of 0.1[0-9]* is lower/improvement of 0.1xxxxx is lower/g
# normalize unique key constraint errors for identity columns
s/^(ERROR: duplicate key value violates unique constraint "\w+)_([0-9])+"/\1_xxxxxx"/g

View File

@ -358,7 +358,7 @@ ERROR: cannot insert a non-DEFAULT value into column "color_id"
DETAIL: Column "color_id" is an identity column defined as GENERATED ALWAYS. DETAIL: Column "color_id" is an identity column defined as GENERATED ALWAYS.
HINT: Use OVERRIDING SYSTEM VALUE to override. HINT: Use OVERRIDING SYSTEM VALUE to override.
INSERT INTO color(color_id, color_name) OVERRIDING SYSTEM VALUE VALUES (1, 'Red'); 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_xxxxxx"
DETAIL: Key (color_id)=(1) already exists. DETAIL: Key (color_id)=(1) already exists.
CONTEXT: while executing command on localhost:xxxxx CONTEXT: while executing command on localhost:xxxxx
-- update null or custom value -- update null or custom value
@ -387,7 +387,7 @@ ERROR: cannot insert a non-DEFAULT value into column "color_id"
DETAIL: Column "color_id" is an identity column defined as GENERATED ALWAYS. DETAIL: Column "color_id" is an identity column defined as GENERATED ALWAYS.
HINT: Use OVERRIDING SYSTEM VALUE to override. HINT: Use OVERRIDING SYSTEM VALUE to override.
INSERT INTO color(color_id, color_name) OVERRIDING SYSTEM VALUE VALUES (1, 'Red'); 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_xxxxxx"
DETAIL: Key (color_id)=(1) already exists. DETAIL: Key (color_id)=(1) already exists.
CONTEXT: while executing command on localhost:xxxxx CONTEXT: while executing command on localhost:xxxxx
-- update null or custom value -- update null or custom value