We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 31471d1 + 5bb8169 commit dc04eafCopy full SHA for dc04eaf
postgresql_metrics/postgres_queries.py
@@ -184,7 +184,8 @@ def get_lock_statistics(conn):
184
185
186
def get_oldest_transaction_timestamp(conn):
187
- sql = ("SELECT datname, now(), xact_start FROM pg_stat_activity WHERE xact_start IS NOT NULL "
+ sql = ("SELECT datname, now(), xact_start FROM pg_stat_activity "
188
+ "WHERE xact_start IS NOT NULL AND datname=current_database() "
189
"ORDER BY xact_start ASC LIMIT 1")
190
results = query(conn, sql)
191
if results:
0 commit comments