aboutsummaryrefslogtreecommitdiff
path: root/src/test/regress/input/constraints.source
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/regress/input/constraints.source')
-rw-r--r--src/test/regress/input/constraints.source10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/test/regress/input/constraints.source b/src/test/regress/input/constraints.source
index 16d38f6d1e7..58c976d95be 100644
--- a/src/test/regress/input/constraints.source
+++ b/src/test/regress/input/constraints.source
@@ -456,6 +456,7 @@ DROP TABLE circles;
CREATE TABLE deferred_excl (
f1 int,
+ f2 int,
CONSTRAINT deferred_excl_con EXCLUDE (f1 WITH =) INITIALLY DEFERRED
);
@@ -470,6 +471,15 @@ INSERT INTO deferred_excl VALUES(3);
INSERT INTO deferred_excl VALUES(3); -- no fail here
COMMIT; -- should fail here
+-- bug #13148: deferred constraint versus HOT update
+BEGIN;
+INSERT INTO deferred_excl VALUES(2, 1); -- no fail here
+DELETE FROM deferred_excl WHERE f1 = 2 AND f2 IS NULL; -- remove old row
+UPDATE deferred_excl SET f2 = 2 WHERE f1 = 2;
+COMMIT; -- should not fail
+
+SELECT * FROM deferred_excl;
+
ALTER TABLE deferred_excl DROP CONSTRAINT deferred_excl_con;
-- This should fail, but worth testing because of HOT updates