| 1 |
# Test for log messages emitted by VACUUM and ANALYZE when a specified |
| 2 |
# relation is concurrently dropped. |
| 3 |
# |
| 4 |
# This also verifies that log messages are not emitted for concurrently |
| 5 |
# dropped relations that were not specified in the VACUUM or ANALYZE |
| 6 |
# command. |
| 7 |
|
| 8 |
setup |
| 9 |
{ |
| 10 |
CREATE TABLE parted (a INT) PARTITION BY LIST (a); |
| 11 |
CREATE TABLE part1 PARTITION OF parted FOR VALUES IN (1); |
| 12 |
CREATE TABLE part2 PARTITION OF parted FOR VALUES IN (2); |
| 13 |
} |
| 14 |
|
| 15 |
teardown |
| 16 |
{ |
| 17 |
DROP TABLE IF EXISTS parted; |
| 18 |
} |
| 19 |
|
| 20 |
session s1 |
| 21 |
step lock |
| 22 |
{ |
| 23 |
BEGIN; |
| 24 |
LOCK part1 IN SHARE MODE; |
| 25 |
} |
| 26 |
step drop_and_commit |
| 27 |
{ |
| 28 |
DROP TABLE part2; |
| 29 |
COMMIT; |
| 30 |
} |
| 31 |
|
| 32 |
session s2 |
| 33 |
step vac_specified { VACUUM part1, part2; } |
| 34 |
step vac_all_parts { VACUUM parted; } |
| 35 |
step analyze_specified { ANALYZE part1, part2; } |
| 36 |
step analyze_all_parts { ANALYZE parted; } |
| 37 |
step vac_analyze_specified { VACUUM ANALYZE part1, part2; } |
| 38 |
step vac_analyze_all_parts { VACUUM ANALYZE parted; } |
| 39 |
|
| 40 |
permutation lock vac_specified drop_and_commit |
| 41 |
permutation lock vac_all_parts drop_and_commit |
| 42 |
permutation lock analyze_specified drop_and_commit |
| 43 |
permutation lock analyze_all_parts drop_and_commit |
| 44 |
permutation lock vac_analyze_specified drop_and_commit |
| 45 |
permutation lock vac_analyze_all_parts drop_and_commit |