From: Guillaume Lelarge Date: Wed, 7 Apr 2010 17:52:43 +0000 (-0400) Subject: Always use ENV{PGSERVICE} to prevent issues with "service=" X-Git-Tag: 2.15.1~46 X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=7d628cfba25cbd973e3a6489008c0f52624fbb55;p=check_postgres.git Always use ENV{PGSERVICE} to prevent issues with "service=" Signed-off-by: Greg Sabino Mullane --- diff --git a/check_postgres.pl b/check_postgres.pl index 1f708baae..d7bb3d7b0 100755 --- a/check_postgres.pl +++ b/check_postgres.pl @@ -1786,12 +1786,7 @@ sub run_command { my @args = ('-q', '-t'); if (defined $db->{dbservice} and length $db->{dbservice}) { ## XX Check for simple names $db->{pname} = "service=$db->{dbservice}"; - if ($psql_version >= 8.3) { - push @args, qq{service=$db->{dbservice}}; - } - else { - $ENV{PGSERVICE} = $db->{dbservice}; - } + $ENV{PGSERVICE} = $db->{dbservice}; } else { $db->{pname} = "port=$db->{port} host=$db->{host} db=$db->{dbname} user=$db->{dbuser}"; @@ -8456,6 +8451,7 @@ Items not specifically attributed are by Greg Sabino Mullane. =item B + Use $ENV{PGSERVICE} instead of "service=" to prevent problems (Guillaume Lelarge) Add --man option to show the entire manual. (Andy Lester) Redo the internal run_command() sub to use -x and hashes instead of regexes. Fix error in custom logic (Andreas Mager)