diff options
author | Greg Sabino Mullane | 2012-10-04 03:41:44 +0000 |
---|---|---|
committer | Greg Sabino Mullane | 2012-10-04 03:41:44 +0000 |
commit | 6d7e38027fd0c82fc995abaf8b2e3b03373a01f0 (patch) | |
tree | d3b8a657c86bc1feb18ca2c4371270f1d6219512 /check_postgres.pl | |
parent | 5c2432cea95e76b226c3dba17c47df517d87262e (diff) |
Make sure SQL2 is defined, per github issue 16
Diffstat (limited to 'check_postgres.pl')
-rwxr-xr-x | check_postgres.pl | 2 |
1 files changed, 1 insertions, 1 deletions
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 }. |