summaryrefslogtreecommitdiffstats
path: root/src/test/isolation/specs/insert-conflict-do-nothing-2.spec
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 12:19:15 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 12:19:15 +0000
commit6eb9c5a5657d1fe77b55cc261450f3538d35a94d (patch)
tree657d8194422a5daccecfd42d654b8a245ef7b4c8 /src/test/isolation/specs/insert-conflict-do-nothing-2.spec
parentInitial commit. (diff)
downloadpostgresql-13-6eb9c5a5657d1fe77b55cc261450f3538d35a94d.tar.xz
postgresql-13-6eb9c5a5657d1fe77b55cc261450f3538d35a94d.zip
Adding upstream version 13.4.upstream/13.4upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/isolation/specs/insert-conflict-do-nothing-2.spec')
-rw-r--r--src/test/isolation/specs/insert-conflict-do-nothing-2.spec34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/test/isolation/specs/insert-conflict-do-nothing-2.spec b/src/test/isolation/specs/insert-conflict-do-nothing-2.spec
new file mode 100644
index 0000000..825b7d6
--- /dev/null
+++ b/src/test/isolation/specs/insert-conflict-do-nothing-2.spec
@@ -0,0 +1,34 @@
+# INSERT...ON CONFLICT DO NOTHING test with multiple rows
+# in higher isolation levels
+
+setup
+{
+ CREATE TABLE ints (key int, val text, PRIMARY KEY (key) INCLUDE (val));
+}
+
+teardown
+{
+ DROP TABLE ints;
+}
+
+session s1
+step beginrr1 { BEGIN ISOLATION LEVEL REPEATABLE READ; }
+step begins1 { BEGIN ISOLATION LEVEL SERIALIZABLE; }
+step donothing1 { INSERT INTO ints(key, val) VALUES(1, 'donothing1') ON CONFLICT DO NOTHING; }
+step c1 { COMMIT; }
+step show { SELECT * FROM ints; }
+
+session s2
+step beginrr2 { BEGIN ISOLATION LEVEL REPEATABLE READ; }
+step begins2 { BEGIN ISOLATION LEVEL SERIALIZABLE; }
+step donothing2 { INSERT INTO ints(key, val) VALUES(1, 'donothing2'), (1, 'donothing3') ON CONFLICT DO NOTHING; }
+step c2 { COMMIT; }
+
+permutation beginrr1 beginrr2 donothing1 c1 donothing2 c2 show
+permutation beginrr1 beginrr2 donothing2 c2 donothing1 c1 show
+permutation beginrr1 beginrr2 donothing1 donothing2 c1 c2 show
+permutation beginrr1 beginrr2 donothing2 donothing1 c2 c1 show
+permutation begins1 begins2 donothing1 c1 donothing2 c2 show
+permutation begins1 begins2 donothing2 c2 donothing1 c1 show
+permutation begins1 begins2 donothing1 donothing2 c1 c2 show
+permutation begins1 begins2 donothing2 donothing1 c2 c1 show