diff --git a/expected/am_vacuum.out b/expected/am_vacuum.out index d689be800..3abb3c668 100644 --- a/expected/am_vacuum.out +++ b/expected/am_vacuum.out @@ -1,3 +1,4 @@ +SELECT count(*) AS columnar_table_count FROM cstore.cstore_tables \gset CREATE TABLE t(a int, b int) USING cstore_tableam; SELECT count(*) FROM cstore.cstore_stripes a, pg_class b WHERE a.relfilenode=b.relfilenode AND b.relname='t'; count @@ -87,3 +88,18 @@ SELECT stripe, attr, block, minimum_value IS NULL, maximum_value IS NULL FROM cs 2 | 2 | 0 | f | f (6 rows) +-- Make sure we cleaned-up the transient table metadata after VACUUM FULL commands +SELECT count(*) - :columnar_table_count FROM cstore.cstore_tables; + ?column? +---------- + 1 +(1 row) + +DROP TABLE t; +-- Make sure we cleaned the metadata for t too +SELECT count(*) - :columnar_table_count FROM cstore.cstore_tables; + ?column? +---------- + 0 +(1 row) + diff --git a/sql/am_vacuum.sql b/sql/am_vacuum.sql index 070a13b05..6a5e0687e 100644 --- a/sql/am_vacuum.sql +++ b/sql/am_vacuum.sql @@ -1,4 +1,7 @@ +SELECT count(*) AS columnar_table_count FROM cstore.cstore_tables \gset + CREATE TABLE t(a int, b int) USING cstore_tableam; + SELECT count(*) FROM cstore.cstore_stripes a, pg_class b WHERE a.relfilenode=b.relfilenode AND b.relname='t'; INSERT INTO t SELECT i, i * i FROM generate_series(1, 10) i; @@ -35,3 +38,10 @@ VACUUM FULL t; SELECT stripe, attr, block, minimum_value IS NULL, maximum_value IS NULL FROM cstore.cstore_skipnodes a, pg_class b WHERE a.relfilenode=b.relfilenode AND b.relname='t' ORDER BY 1, 2, 3; +-- Make sure we cleaned-up the transient table metadata after VACUUM FULL commands +SELECT count(*) - :columnar_table_count FROM cstore.cstore_tables; + +DROP TABLE t; + +-- Make sure we cleaned the metadata for t too +SELECT count(*) - :columnar_table_count FROM cstore.cstore_tables;