From 6d7e38027fd0c82fc995abaf8b2e3b03373a01f0 Mon Sep 17 00:00:00 2001 From: Greg Sabino Mullane Date: Wed, 3 Oct 2012 23:41:44 -0400 Subject: Make sure SQL2 is defined, per github issue 16 --- check_postgres.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'check_postgres.pl') diff --git a/check_postgres.pl b/check_postgres.pl index f11740be7..395ea508e 100755 --- a/check_postgres.pl +++ b/check_postgres.pl @@ -7538,7 +7538,7 @@ sub check_txn_idle { $SQL2 =~ s/BY xact_start,/BY/; } else { - $SQL = q{SELECT datname, datid, procpid AS pid, usename, client_addr, current_query AS current_query, '' AS state, }. + $SQL2 = $SQL = q{SELECT datname, datid, procpid AS pid, usename, client_addr, current_query AS current_query, '' AS state, }. q{CASE WHEN client_port < 0 THEN 0 ELSE client_port END AS client_port, }. qq{COALESCE(ROUND(EXTRACT(epoch FROM now()-$start)),0) AS seconds }. qq{FROM pg_stat_activity WHERE $clause$USERWHERECLAUSE }. -- cgit v1.2.3