summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Sabino Mullane2014-07-14 16:50:34 +0000
committerGreg Sabino Mullane2014-07-14 16:50:34 +0000
commit2fef14b64f5c362b8684d2a53e6e8e7e9028f844 (patch)
tree29d4f5f4fb71fdd0b261e90833e417574ee6661b
parent4fb3e757fb09a92abc433cdd5ebdf01a084818c2 (diff)
When we fail to parse the psql output, show the entire output string rather than just the failing line, to better aid in debugging as recently seen on the list.
-rwxr-xr-xcheck_postgres.pl4
1 files changed, 3 insertions, 1 deletions
diff --git a/check_postgres.pl b/check_postgres.pl
index 508fc037a..a8fdb97f8 100755
--- a/check_postgres.pl
+++ b/check_postgres.pl
@@ -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;
}
}