When we fail to parse the psql output, show the entire output string rather than...
authorGreg Sabino Mullane <[email protected]>
Mon, 14 Jul 2014 16:50:34 +0000 (12:50 -0400)
committerGreg Sabino Mullane <[email protected]>
Mon, 14 Jul 2014 16:50:34 +0000 (12:50 -0400)
check_postgres.pl

index 508fc037acb59762b27d8df2a7cc638ba7d972a9..a8fdb97f8d8e6f30380757a295dfe366ddb168f8 100755 (executable)
@@ -2490,7 +2490,7 @@ sub run_command {
                     warn "Output:           $line\n";
                     $args =~ s/ -c (.+)/ -c "$1"/s;
                     warn "Command:          $PSQL $args\n";
-                    ## Last thing is to see if we can grab the PG version
+                    ## Next to last thing is to see if we can grab the PG version
                     if (! $opt{stop_looping}) {
                         ## Just in case...
                         $opt{stop_looping} = 1;
@@ -2498,6 +2498,8 @@ sub run_command {
                         (my $v = $linfo->{db}[0]{slurp}[0]{version}) =~ s/(\w+ \S+).+/$1/;
                         warn "Postgres version: $v\n";
                     }
+                    ## This is a serious parsing fail, so it can be helpful to have the whole enchilada:
+                    warn "Full output: $db->{slurp}\n\n";
                     exit 1;
                 }
             }