$Data::Dumper::Indent = 2;
$Data::Dumper::Useqq = 1;
-our $VERSION = '2.3.7';
+our $VERSION = '2.3.8';
+
+our $DEF_PGPORT = 5432;
use vars qw/ %opt $PSQL $res $COM $SQL $db /;
Common connection options:
-H, --host=NAME hostname(s) to connect to; defaults to none (Unix socket)
- -p, --port=NUM port(s) to connect to; defaults to 5432.
+ -p, --port=NUM port(s) to connect to; defaults to $DEF_PGPORT.
-db, --dbname=NAME database name(s) to connect to; defaults to 'postgres' or 'template1'
-u --dbuser=NAME database user(s) to connect as; defaults to 'postgres'
--dbpass=PASS database password(s); use a .pgpass file instead when possible
my $header = sprintf q{%s%s%s},
$action_info->{$action}[0] ? '' : qq{DB "$db->{dbname}" },
$db->{host} eq '<none>' ? '' : qq{(host:$db->{host}) },
- $db->{port} eq '5432' ? '' : qq{(port=$db->{port}) };
+ $db->{port} eq $DEF_PGPORT ? '' : qq{(port=$db->{port}) };
$header =~ s/\s+$//;
my $perf = $opt{showtime} ? "time=$db->{totaltime}" : '';
if ($db->{perf}) {
my $conn =
{
host => ['<none>'],
- port => [5432],
+ port => [$DEF_PGPORT],
dbname => [$opt{defaultdb}],
dbuser => [$opt{defaultuser}],
dbpass => [''],