--- postgres_locks 2007/06/12 11:05:50 2 +++ postgres_locks 2007/06/12 11:13:25 3 @@ -2,7 +2,7 @@ use strict; use DBI; -my $dbhost = $ENV{'dbhost'}; +my $dbhost = $ENV{'dbhost'} || ''; my $dbname = $ENV{'dbname'} || 'template1'; my $dbuser = $ENV{'dbuser'} || 'postgres'; my $dbpass = $ENV{'dbpass'} || ''; @@ -26,7 +26,7 @@ exlocks.critical 10 EOF } else { - my $Con = "DBI:Pg:dbname=$dbname", $dbhost ? ";host=$dbhost" : ""; + my $Con = "DBI:Pg:dbname=$dbname" . ( $dbhost ? ";host=$dbhost" : "" ); my $Dbh = DBI->connect ($Con, $dbuser, $dbpass,