summaryrefslogtreecommitdiffstats
path: root/src/test/isolation/specs/vacuum-concurrent-drop.spec
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 13:44:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 13:44:03 +0000
commit293913568e6a7a86fd1479e1cff8e2ecb58d6568 (patch)
treefc3b469a3ec5ab71b36ea97cc7aaddb838423a0c /src/test/isolation/specs/vacuum-concurrent-drop.spec
parentInitial commit. (diff)
downloadpostgresql-16-293913568e6a7a86fd1479e1cff8e2ecb58d6568.tar.xz
postgresql-16-293913568e6a7a86fd1479e1cff8e2ecb58d6568.zip
Adding upstream version 16.2.upstream/16.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/isolation/specs/vacuum-concurrent-drop.spec')
-rw-r--r--src/test/isolation/specs/vacuum-concurrent-drop.spec45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/test/isolation/specs/vacuum-concurrent-drop.spec b/src/test/isolation/specs/vacuum-concurrent-drop.spec
new file mode 100644
index 0000000..148a2d5
--- /dev/null
+++ b/src/test/isolation/specs/vacuum-concurrent-drop.spec
@@ -0,0 +1,45 @@
+# Test for log messages emitted by VACUUM and ANALYZE when a specified
+# relation is concurrently dropped.
+#
+# This also verifies that log messages are not emitted for concurrently
+# dropped relations that were not specified in the VACUUM or ANALYZE
+# command.
+
+setup
+{
+ CREATE TABLE parted (a INT) PARTITION BY LIST (a);
+ CREATE TABLE part1 PARTITION OF parted FOR VALUES IN (1);
+ CREATE TABLE part2 PARTITION OF parted FOR VALUES IN (2);
+}
+
+teardown
+{
+ DROP TABLE IF EXISTS parted;
+}
+
+session s1
+step lock
+{
+ BEGIN;
+ LOCK part1 IN SHARE MODE;
+}
+step drop_and_commit
+{
+ DROP TABLE part2;
+ COMMIT;
+}
+
+session s2
+step vac_specified { VACUUM part1, part2; }
+step vac_all_parts { VACUUM parted; }
+step analyze_specified { ANALYZE part1, part2; }
+step analyze_all_parts { ANALYZE parted; }
+step vac_analyze_specified { VACUUM ANALYZE part1, part2; }
+step vac_analyze_all_parts { VACUUM ANALYZE parted; }
+
+permutation lock vac_specified drop_and_commit
+permutation lock vac_all_parts drop_and_commit
+permutation lock analyze_specified drop_and_commit
+permutation lock analyze_all_parts drop_and_commit
+permutation lock vac_analyze_specified drop_and_commit
+permutation lock vac_analyze_all_parts drop_and_commit