Get rid of "uninitialized value" warnings.
authorHenrik Ahlgren <[email protected]>
Fri, 14 Sep 2012 07:11:20 +0000 (10:11 +0300)
committerGreg Sabino Mullane <[email protected]>
Mon, 11 Feb 2013 20:03:09 +0000 (15:03 -0500)
check_postgres.pl

index 7a2d48f11510f0bd4879b02af7069536de27363f..d62dc81787a0368e088c499cd22084eaaabc5bac 100755 (executable)
@@ -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