summaryrefslogtreecommitdiffstats
path: root/src/test/isolation/specs/fk-partitioned-1.spec
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 12:15:05 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 12:15:05 +0000
commit46651ce6fe013220ed397add242004d764fc0153 (patch)
tree6e5299f990f88e60174a1d3ae6e48eedd2688b2b /src/test/isolation/specs/fk-partitioned-1.spec
parentInitial commit. (diff)
downloadpostgresql-14-upstream.tar.xz
postgresql-14-upstream.zip
Adding upstream version 14.5.upstream/14.5upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/isolation/specs/fk-partitioned-1.spec')
-rw-r--r--src/test/isolation/specs/fk-partitioned-1.spec45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/test/isolation/specs/fk-partitioned-1.spec b/src/test/isolation/specs/fk-partitioned-1.spec
new file mode 100644
index 0000000..f71ee5c
--- /dev/null
+++ b/src/test/isolation/specs/fk-partitioned-1.spec
@@ -0,0 +1,45 @@
+# Verify that cloning a foreign key constraint to a partition ensures
+# that referenced values exist, even if they're being concurrently
+# deleted.
+setup {
+drop table if exists ppk, pfk, pfk1;
+ create table ppk (a int primary key) partition by list (a);
+ create table ppk1 partition of ppk for values in (1);
+ insert into ppk values (1);
+ create table pfk (a int references ppk) partition by list (a);
+ create table pfk1 (a int not null);
+ insert into pfk1 values (1);
+}
+
+session s1
+step s1b { begin; }
+step s1d { delete from ppk1 where a = 1; }
+step s1c { commit; }
+
+session s2
+step s2b { begin; }
+step s2a { alter table pfk attach partition pfk1 for values in (1); }
+step s2c { commit; }
+
+teardown { drop table ppk, pfk, pfk1; }
+
+permutation s1b s1d s1c s2b s2a s2c
+permutation s1b s1d s2b s1c s2a s2c
+permutation s1b s1d s2b s2a s1c s2c
+#permutation s1b s1d s2b s2a s2c s1c
+permutation s1b s2b s1d s1c s2a s2c
+permutation s1b s2b s1d s2a s1c s2c
+#permutation s1b s2b s1d s2a s2c s1c
+#permutation s1b s2b s2a s1d s1c s2c
+permutation s1b s2b s2a s1d s2c s1c
+permutation s1b s2b s2a s2c s1d s1c
+permutation s2b s1b s1d s1c s2a s2c
+permutation s2b s1b s1d s2a s1c s2c
+#permutation s2b s1b s1d s2a s2c s1c
+#permutation s2b s1b s2a s1d s1c s2c
+permutation s2b s1b s2a s1d s2c s1c
+permutation s2b s1b s2a s2c s1d s1c
+#permutation s2b s2a s1b s1d s1c s2c
+permutation s2b s2a s1b s1d s2c s1c
+permutation s2b s2a s1b s2c s1d s1c
+permutation s2b s2a s2c s1b s1d s1c