aboutsummaryrefslogtreecommitdiff
path: root/src/test/regress/output/constraints.source
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/regress/output/constraints.source')
-rw-r--r--src/test/regress/output/constraints.source23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/test/regress/output/constraints.source b/src/test/regress/output/constraints.source
index eff793cc3d3..28e3f2c717b 100644
--- a/src/test/regress/output/constraints.source
+++ b/src/test/regress/output/constraints.source
@@ -575,6 +575,29 @@ COMMIT;
ERROR: duplicate key value violates unique constraint "parted_uniq_tbl_1_i_key"
DETAIL: Key (i)=(1) already exists.
DROP TABLE parted_uniq_tbl;
+-- test naming a constraint in a partition when a conflict exists
+CREATE TABLE parted_fk_naming (
+ id bigint NOT NULL default 1,
+ id_abc bigint,
+ CONSTRAINT dummy_constr FOREIGN KEY (id_abc)
+ REFERENCES parted_fk_naming (id),
+ PRIMARY KEY (id)
+)
+PARTITION BY LIST (id);
+CREATE TABLE parted_fk_naming_1 (
+ id bigint NOT NULL default 1,
+ id_abc bigint,
+ PRIMARY KEY (id),
+ CONSTRAINT dummy_constr CHECK (true)
+);
+ALTER TABLE parted_fk_naming ATTACH PARTITION parted_fk_naming_1 FOR VALUES IN ('1');
+SELECT conname FROM pg_constraint WHERE conrelid = 'parted_fk_naming_1'::regclass AND contype = 'f';
+ conname
+--------------------------------
+ parted_fk_naming_1_id_abc_fkey
+(1 row)
+
+DROP TABLE parted_fk_naming;
-- test a HOT update that invalidates the conflicting tuple.
-- the trigger should still fire and catch the violation
BEGIN;