diff --git a/lib/pg_repack.sql.in b/lib/pg_repack.sql.in index 33c9868..862ed84 100644 --- a/lib/pg_repack.sql.in +++ b/lib/pg_repack.sql.in @@ -184,6 +184,8 @@ FROM ( WHERE oid = $1 ) as t +$$ +LANGUAGE sql STABLE STRICT; -- GET a SQL text to set column storage option for the table. CREATE FUNCTION repack.get_alter_col_storage(oid) diff --git a/regress/expected/repack.out b/regress/expected/repack.out index ebecc9a..dd4541d 100644 --- a/regress/expected/repack.out +++ b/regress/expected/repack.out @@ -314,6 +314,7 @@ ORDER BY 1; 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) + SELECT pg_relation_size(reltoastrelid) = 0 as check_toast_rel_size FROM pg_class WHERE relname = 'tbl_with_mod_column_storage'; check_toast_rel_size ---------------------- diff --git a/regress/expected/repack_1.out b/regress/expected/repack_1.out index 3c2f62e..a7bbe2f 100644 --- a/regress/expected/repack_1.out +++ b/regress/expected/repack_1.out @@ -314,6 +314,7 @@ ORDER BY 1; 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) + SELECT pg_relation_size(reltoastrelid) = 0 as check_toast_rel_size FROM pg_class WHERE relname = 'tbl_with_mod_column_storage'; check_toast_rel_size ----------------------