Fix regression test failure.

This commit is contained in:
Masahiko Sawada 2017-04-03 21:10:28 +09:00 committed by Daniele Varrazzo
parent ca5ca11d4d
commit c44306ba74
3 changed files with 27 additions and 3 deletions

View File

@ -299,11 +299,12 @@ SELECT CASE relkind
END as table,
reloptions
FROM pg_class
WHERE relname = 'tbl_with_toast' OR relname = 'pg_toast_' || 'tbl_with_toast'::regclass::oid;
WHERE relname = 'tbl_with_toast' OR relname = 'pg_toast_' || 'tbl_with_toast'::regclass::oid
ORDER BY 1;
table | reloptions
----------------+---------------------------------------------------------------------
toast_table | {autovacuum_vacuum_scale_factor=40,autovacuum_vacuum_threshold=400}
tbl_with_toast | {autovacuum_vacuum_scale_factor=30,autovacuum_vacuum_threshold=300}
toast_table | {autovacuum_vacuum_scale_factor=40,autovacuum_vacuum_threshold=400}
(2 rows)
--

View File

@ -58,6 +58,12 @@ CREATE INDEX idxopts_t ON tbl_idxopts (t DESC NULLS LAST) WHERE (t != 'aaa');
-- Use this table to play with attribute options too
ALTER TABLE tbl_idxopts ALTER i SET STATISTICS 1;
ALTER TABLE tbl_idxopts ALTER t SET (n_distinct = -0.5);
CREATE TABLE tbl_with_toast (
i integer PRIMARY KEY,
c text
);
ALTER TABLE tbl_with_toast SET (AUTOVACUUM_VACUUM_SCALE_FACTOR = 30, AUTOVACUUM_VACUUM_THRESHOLD = 300);
ALTER TABLE tbl_with_toast SET (TOAST.AUTOVACUUM_VACUUM_SCALE_FACTOR = 40, TOAST.AUTOVACUUM_VACUUM_THRESHOLD = 400);
--
-- insert data
--
@ -131,6 +137,7 @@ INFO: repacking table "tbl_with_dropped_toast"
INFO: repacking table "tbl_badindex"
WARNING: skipping invalid index: CREATE UNIQUE INDEX idx_badindex_n ON tbl_badindex USING btree (n)
INFO: repacking table "tbl_idxopts"
INFO: repacking table "tbl_with_toast"
--
-- after
--
@ -285,6 +292,21 @@ SELECT * FROM tbl_with_dropped_toast;
RESET enable_seqscan;
RESET enable_indexscan;
-- check if storage option for both table and TOAST table didn't go away.
SELECT CASE relkind
WHEN 'r' THEN relname
WHEN 't' THEN 'toast_table'
END as table,
reloptions
FROM pg_class
WHERE relname = 'tbl_with_toast' OR relname = 'pg_toast_' || 'tbl_with_toast'::regclass::oid
ORDER BY 1;
table | reloptions
----------------+---------------------------------------------------------------------
tbl_with_toast | {autovacuum_vacuum_scale_factor=30,autovacuum_vacuum_threshold=300}
toast_table | {autovacuum_vacuum_scale_factor=40,autovacuum_vacuum_threshold=400}
(2 rows)
--
-- check broken links or orphan toast relations
--

View File

@ -170,7 +170,8 @@ SELECT CASE relkind
END as table,
reloptions
FROM pg_class
WHERE relname = 'tbl_with_toast' OR relname = 'pg_toast_' || 'tbl_with_toast'::regclass::oid;
WHERE relname = 'tbl_with_toast' OR relname = 'pg_toast_' || 'tbl_with_toast'::regclass::oid
ORDER BY 1;
--
-- check broken links or orphan toast relations