Make sure SQL2 is defined, per github issue 16
authorGreg Sabino Mullane <[email protected]>
Thu, 4 Oct 2012 03:41:44 +0000 (23:41 -0400)
committerGreg Sabino Mullane <[email protected]>
Thu, 4 Oct 2012 03:41:44 +0000 (23:41 -0400)
check_postgres.pl

index f11740be7299725c3dbb0f92cc7fafd8eff0e40d..395ea508e68630900fdacff53d1d3819f38d920a 100755 (executable)
@@ -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 }.