mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-08-30 04:07:20 +02:00
Try to stabilize vacuum test.
As commitsb700f96c
and3414099c
did for the reloptions test, make sure VACUUM can always truncate the table as expected. Back-patch to 12, where vacuum_truncate arrived. Discussion: https://postgr.es/m/CAD21AoCNoWjYkdEtr%2BVDoF9v__V905AedKZ9iF%3DArgCtrbxZqw%40mail.gmail.com
This commit is contained in:
parent
f183e23cc8
commit
f784fcdc44
@ -163,19 +163,19 @@ VACUUM (INDEX_CLEANUP FALSE) vaccluster;
|
||||
VACUUM (INDEX_CLEANUP FALSE) vactst; -- index cleanup option is ignored if no indexes
|
||||
VACUUM (INDEX_CLEANUP FALSE, FREEZE TRUE) vaccluster;
|
||||
-- TRUNCATE option
|
||||
CREATE TABLE vac_truncate_test(i INT NOT NULL, j text)
|
||||
CREATE TEMP TABLE vac_truncate_test(i INT NOT NULL, j text)
|
||||
WITH (vacuum_truncate=true, autovacuum_enabled=false);
|
||||
INSERT INTO vac_truncate_test VALUES (1, NULL), (NULL, NULL);
|
||||
ERROR: null value in column "i" of relation "vac_truncate_test" violates not-null constraint
|
||||
DETAIL: Failing row contains (null, null).
|
||||
VACUUM (TRUNCATE FALSE) vac_truncate_test;
|
||||
VACUUM (TRUNCATE FALSE, DISABLE_PAGE_SKIPPING) vac_truncate_test;
|
||||
SELECT pg_relation_size('vac_truncate_test') > 0;
|
||||
?column?
|
||||
----------
|
||||
t
|
||||
(1 row)
|
||||
|
||||
VACUUM vac_truncate_test;
|
||||
VACUUM (DISABLE_PAGE_SKIPPING) vac_truncate_test;
|
||||
SELECT pg_relation_size('vac_truncate_test') = 0;
|
||||
?column?
|
||||
----------
|
||||
|
@ -145,12 +145,12 @@ VACUUM (INDEX_CLEANUP FALSE) vactst; -- index cleanup option is ignored if no in
|
||||
VACUUM (INDEX_CLEANUP FALSE, FREEZE TRUE) vaccluster;
|
||||
|
||||
-- TRUNCATE option
|
||||
CREATE TABLE vac_truncate_test(i INT NOT NULL, j text)
|
||||
CREATE TEMP TABLE vac_truncate_test(i INT NOT NULL, j text)
|
||||
WITH (vacuum_truncate=true, autovacuum_enabled=false);
|
||||
INSERT INTO vac_truncate_test VALUES (1, NULL), (NULL, NULL);
|
||||
VACUUM (TRUNCATE FALSE) vac_truncate_test;
|
||||
VACUUM (TRUNCATE FALSE, DISABLE_PAGE_SKIPPING) vac_truncate_test;
|
||||
SELECT pg_relation_size('vac_truncate_test') > 0;
|
||||
VACUUM vac_truncate_test;
|
||||
VACUUM (DISABLE_PAGE_SKIPPING) vac_truncate_test;
|
||||
SELECT pg_relation_size('vac_truncate_test') = 0;
|
||||
VACUUM (TRUNCATE FALSE, FULL TRUE) vac_truncate_test;
|
||||
DROP TABLE vac_truncate_test;
|
||||
|
Loading…
Reference in New Issue
Block a user