diff options
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 7a2d48f11..d62dc8178 100755 --- a/check_postgres.pl +++ b/check_postgres.pl @@ -2251,7 +2251,7 @@ sub run_command { $ENV{PGSERVICE} = $db->{dbservice}; } else { - $db->{pname} = "port=$db->{port} host=$db->{host} db=$db->{dbname} user=$db->{dbuser}"; + $db->{pname} = "port=" . ($db->{port} || $opt{defaultport}) . " host=$db->{host} db=$db->{dbname} user=$db->{dbuser}"; } ## If all we want is a connection string, give it and leave now |