From: Greg Sabino Mullane Date: Sun, 20 Oct 2013 02:10:32 +0000 (-0400) Subject: When doing `bucardo list databases`, don't show the psql port connection param unless... X-Git-Tag: 4.99.9~30 X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=853cf7b804aedc246843dd045895e3e27e4fc2f9;p=bucardo.git When doing `bucardo list databases`, don't show the psql port connection param unless it is set to something. --- diff --git a/bucardo b/bucardo index 59464b7a8..95f6195bf 100755 --- a/bucardo +++ b/bucardo @@ -1942,9 +1942,10 @@ sub list_databases { $showtypes ? $type : '', $maxstat, $info->{status}; my $showhost = length $info->{dbhost} ? " -h $info->{dbhost}" : ''; + my $showport = $info->{dbport} =~ /\d/ ? " -p $info->{dbport}" : ''; my $dbtype = $info->{dbtype}; if ($dbtype eq 'postgres') { - print "Conn: psql -p $info->{dbport} -U $info->{dbuser} -d $info->{dbname}$showhost"; + print "Conn: psql$showport -U $info->{dbuser} -d $info->{dbname}$showhost"; if (! $info->{server_side_prepares}) { print ' (SSP is off)'; }