When listing psql output for "bucardo list dbs", show the conninfo if we have one.
authorGreg Sabino Mullane <greg@endpoint.com>
Wed, 3 Feb 2016 20:06:47 +0000 (15:06 -0500)
committerGreg Sabino Mullane <greg@endpoint.com>
Wed, 3 Feb 2016 20:06:47 +0000 (15:06 -0500)
bucardo

diff --git a/bucardo b/bucardo
index f501e16fb321f49c078c93e48ae2c49ee375424b..8a78f29e87ac13d79bdf9371486fe01ec4f6d1d6 100755 (executable)
--- a/bucardo
+++ b/bucardo
@@ -2424,9 +2424,13 @@ sub list_databases {
             $maxstat, $info->{status};
         my $showhost = length $info->{dbhost} ? " -h $info->{dbhost}" : '';
         my $showport = $info->{dbport} =~ /\d/ ? " -p $info->{dbport}" : '';
+        my $dbname = "-d $info->{dbname}";
+        if (length $info->{dbconn}) {
+            $dbname = qq{-d "dbname=$info->{dbname} $info->{dbconn}"};
+        }
         my $dbtype = $info->{dbtype};
         if ($dbtype eq 'postgres') {
-            print "Conn: psql$showport -U $info->{dbuser} -d $info->{dbname}$showhost";
+            print "Conn: psql$showport -U $info->{dbuser} $dbname$showhost";
             if (! $info->{server_side_prepares}) {
                 print ' (SSP is off)';
             }