File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -18,11 +18,11 @@ class Pool(object):
1818 'select public.mamonsu_timestamp_get()'
1919 ),
2020 'count_xlog_files' : (
21- "select count(*) from pg_catalog.pg_ls_dir('pg_xlog')" ,
21+ "WITH list(filename) as (SELECT * FROM pg_catalog.pg_ls_dir('pg_xlog')) SELECT COUNT(*)::BIGINT FROM list WHERE filename similar to [0-9A-F]{24} " ,
2222 'select public.mamonsu_count_xlog_files()'
2323 ),
2424 'count_wal_files' : (
25- "select count(*) from pg_catalog.pg_ls_dir('pg_wal')" ,
25+ "WITH list(filename) as (SELECT * FROM pg_catalog.pg_ls_dir('pg_wal')) SELECT COUNT(*)::BIGINT FROM list WHERE filename similar to [0-9A-F]{24} " ,
2626 'select public.mamonsu_count_wal_files()'
2727 ),
2828 'count_autovacuum' : (
Original file line number Diff line number Diff line change 7777 FROM pg_catalog.pg_stat_activity
7878 WHERE
7979 pid NOT IN(select pid from pg_stat_replication) AND
80- pid <> pg_backend_pid() AND
81- query NOT ilike '%%VACUUM%%'
80+ pid <> pg_backend_pid()
8281$$ LANGUAGE SQL SECURITY DEFINER;
8382
8483CREATE OR REPLACE FUNCTION public.mamonsu_count_{3}_files()
You can’t perform that action at this time.
0 commit comments