File tree 2 files changed +4
-4
lines changed
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -19,15 +19,15 @@ class Oldest(Plugin):
19
19
OldestQuerySql = """
20
20
SELECT
21
21
CASE WHEN extract(epoch from max(now() - xact_start)) IS NOT null
22
+ AND extract(epoch from max(now() - xact_start))>0
22
23
THEN extract(epoch from max(now() - xact_start))
23
24
ELSE 0
24
25
END
25
26
FROM pg_catalog.pg_stat_activity
26
27
WHERE
27
28
pid NOT IN(select pid from pg_stat_replication) AND
28
29
pid <> pg_backend_pid() AND
29
- query NOT ilike '%%VACUUM%%'
30
- HAVING extract(epoch from max(now() - xact_start))>0;
30
+ query NOT ilike '%%VACUUM%%';
31
31
"""
32
32
33
33
OldestQuerySql_bootstrap = """
Original file line number Diff line number Diff line change 69
69
RETURNS DOUBLE PRECISION AS $$
70
70
SELECT
71
71
CASE WHEN extract(epoch from max(now() - xact_start)) IS NOT null
72
+ AND extract(epoch from max(now() - xact_start))>0
72
73
THEN extract(epoch from max(now() - xact_start))
73
74
ELSE 0
74
75
END
75
76
FROM pg_catalog.pg_stat_activity
76
77
WHERE
77
78
pid NOT IN(select pid from pg_stat_replication) AND
78
79
pid <> pg_backend_pid() AND
79
- query NOT ilike '%%VACUUM%%'
80
- HAVING extract(epoch from max(now() - xact_start))>0
80
+ query NOT ilike '%%VACUUM%%'
81
81
$$ LANGUAGE SQL SECURITY DEFINER;
82
82
83
83
CREATE OR REPLACE FUNCTION public.mamonsu_count_{3}_files()
You can’t perform that action at this time.
0 commit comments