From: Greg Sabino Mullane Date: Mon, 4 Jul 2011 18:44:42 +0000 (-0400) Subject: The database name is not always available (e.g. check_checkpoint) X-Git-Tag: 2.18.0~23 X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=f64d44f49ac06411a136db1177edbbdd71538495;p=check_postgres.git The database name is not always available (e.g. check_checkpoint) --- diff --git a/check_postgres.pl b/check_postgres.pl index 3be87c1ae..740f635d9 100755 --- a/check_postgres.pl +++ b/check_postgres.pl @@ -1338,7 +1338,7 @@ sub add_response { } my $dbservice = $db->{dbservice}; - my $dbname = qq{DB "$db->{dbname}"}; + my $dbname = defined $db->{dbname} ? qq{DB "$db->{dbname}"} : ''; my $dbhost = (!$db->{host} or $db->{host} eq '') ? '' : qq{ (host:$db->{host})}; my $dbport = defined $db->{port} ? ($db->{port} eq $opt{defaultport} ? '' : qq{ (port=$db->{port}) }) : '';