8000 compression_ratio fix for empty tables · postgrespro/mamonsu@b993751 · GitHub
[go: up one dir, main page]

Skip to content

Commit b993751

Browse files
committed
compression_ratio fix for empty tables
1 parent 4fa877d commit b993751

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

mamonsu/plugins/pgsql/cfs.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ class Cfs(Plugin):
2121
left join pg_catalog.pg_namespace n on n.oid = c.relnamespace
2222
where c.reltablespace in (select oid from pg_catalog.pg_tablespace where spcoptions::text ~ 'compression')
2323
and c.relkind IN ('r','v','m','S','f','')
24+
and cfs_compression_ratio(c.oid::regclass) <> 'NaN'
2425
2526
union all
2627
@@ -32,7 +33,8 @@ class Cfs(Plugin):
3233
pg_catalog.pg_class as c
3334
left join pg_catalog.pg_namespace n on n.oid = c.relnamespace
3435
where c.reltablespace in (select oid from pg_catalog.pg_tablespace where spcoptions::text ~ 'compression')
35-
and c.relkind = 'i' and n.nspname <> 'pg_toast';
36+
and c.relkind = 'i' and n.nspname <> 'pg_toast'
37+
and cfs_compression_ratio(c.oid::regclass) <> 'NaN';
3638
"""
3739

3840
activity_sql = """

0 commit comments

Comments
 (0)
0