File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,12 @@ class Oldest(Plugin):
1919 OldestQuerySql = """
2020select
2121 extract(epoch from max(now() - xact_start))
22- from pg_catalog.pg_stat_activity where pid not in (select pid from pg_stat_replication);
22+ from pg_catalog.pg_stat_activity
23+ where
24+ pid not in (select pid from pg_stat_replication)
25+ AND pid <> pg_backend_pid()
26+ AND query not ilike '%VACUUM%'
27+ HAVING extract(epoch from max(now() - xact_start))>0;
2328"""
2429
2530 OldestQuerySql_bootstrap = """
Original file line number Diff line number Diff line change 7070 SELECT
7171 extract(epoch from max(now() - xact_start))
7272 FROM pg_catalog.pg_stat_activity
73- WHERE pid not in (select pid from pg_stat_replication)
73+ WHERE
74+ pid not in (select pid from pg_stat_replication)
75+ AND pid <> pg_backend_pid()
76+ AND query not ilike '%VACUUM%'
77+ HAVING extract(epoch from max(now() - xact_start))>0
7478$$ LANGUAGE SQL SECURITY DEFINER;
7579
7680CREATE OR REPLACE FUNCTION public.mamonsu_count_{3}_files()
You can’t perform that action at this time.
0 commit comments