Do not show service connection information if it is empty
authorGreg Sabino Mullane <greg@endpoint.com>
Wed, 7 Sep 2016 15:25:06 +0000 (11:25 -0400)
committerGreg Sabino Mullane <greg@endpoint.com>
Wed, 7 Sep 2016 15:25:06 +0000 (11:25 -0400)
bucardo

diff --git a/bucardo b/bucardo
index 08c44c04e3912ac23173448c9af5e1e82acb10b0..1c6146a93422e14aacc3bbc1bda9ec2840683bd6 100755 (executable)
--- a/bucardo
+++ b/bucardo
@@ -2432,7 +2432,7 @@ sub list_databases {
         if ($dbtype eq 'postgres') {
             my $showuser = defined $info->{dbuser} ? "-U $info->{dbuser}" : '';
             my $showdb = defined $info->{dbname} ? " -d $info->{dbname}" : '';
-            my $showservice = defined $info->{dbservice} ? qq{ "service=$info->{dbservice}"} : '';
+            my $showservice = (defined $info->{dbservice} and length $info->{dbservice}) ? qq{ "service=$info->{dbservice}"} : '';
             print "Conn: psql$showport $showuser$showdb$showhost$showservice";
             if (! $info->{server_side_prepares}) {
                 print ' (SSP is off)';