summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/modules/commit_ts/t/003_standby_2.pl2
-rw-r--r--src/test/modules/libpq_pipeline/t/001_libpq_pipeline.pl4
-rw-r--r--src/test/modules/ssl_passphrase_callback/t/001_testfunc.pl8
-rw-r--r--src/test/modules/test_pg_dump/t/001_base.pl159
-rw-r--r--src/test/perl/PostgreSQL/Test/BackgroundPsql.pm9
-rw-r--r--src/test/perl/PostgreSQL/Test/Cluster.pm140
-rw-r--r--src/test/perl/PostgreSQL/Test/Kerberos.pm2
-rw-r--r--src/test/perl/PostgreSQL/Test/Utils.pm40
-rw-r--r--src/test/postmaster/t/002_connection_limits.pl5
-rw-r--r--src/test/recovery/t/001_stream_rep.pl48
-rw-r--r--src/test/recovery/t/006_logical_decoding.pl7
-rw-r--r--src/test/recovery/t/013_crash_restart.pl29
-rw-r--r--src/test/recovery/t/017_shm.pl18
-rw-r--r--src/test/recovery/t/021_row_visibility.pl30
-rw-r--r--src/test/recovery/t/022_crash_temp_files.pl30
-rw-r--r--src/test/recovery/t/032_relfilenode_reuse.pl30
-rw-r--r--src/test/recovery/t/035_standby_logical_decoding.pl36
-rw-r--r--src/test/recovery/t/040_standby_failover_slots_sync.pl2
-rw-r--r--src/test/recovery/t/041_checkpoint_at_promote.pl15
19 files changed, 342 insertions, 272 deletions
diff --git a/src/test/modules/commit_ts/t/003_standby_2.pl b/src/test/modules/commit_ts/t/003_standby_2.pl
index 69ffd969e10..3b27da6b237 100644
--- a/src/test/modules/commit_ts/t/003_standby_2.pl
+++ b/src/test/modules/commit_ts/t/003_standby_2.pl
@@ -57,7 +57,7 @@ $primary->restart;
$primary->append_conf('postgresql.conf', 'track_commit_timestamp = off');
$primary->restart;
-system_or_bail('pg_ctl', '-D', $standby->data_dir, 'promote');
+system_or_bail('pg_ctl', '--pgdata' => $standby->data_dir, 'promote');
$standby->safe_psql('postgres', "create table t11()");
my $standby_ts = $standby->safe_psql('postgres',
diff --git a/src/test/modules/libpq_pipeline/t/001_libpq_pipeline.pl b/src/test/modules/libpq_pipeline/t/001_libpq_pipeline.pl
index e301c378264..9691b850418 100644
--- a/src/test/modules/libpq_pipeline/t/001_libpq_pipeline.pl
+++ b/src/test/modules/libpq_pipeline/t/001_libpq_pipeline.pl
@@ -35,7 +35,7 @@ mkdir "$PostgreSQL::Test::Utils::tmp_check/traces";
for my $testname (@tests)
{
- my @extraargs = ('-r', $numrows);
+ my @extraargs = ('-r' => $numrows);
my $cmptrace = grep(/^$testname$/,
qw(simple_pipeline nosync multi_pipelines prepared singlerow
pipeline_abort pipeline_idle transaction
@@ -46,7 +46,7 @@ for my $testname (@tests)
"$PostgreSQL::Test::Utils::tmp_check/traces/$testname.trace";
if ($cmptrace)
{
- push @extraargs, "-t", $traceout;
+ push @extraargs, "-t" => $traceout;
}
# Execute the test
diff --git a/src/test/modules/ssl_passphrase_callback/t/001_testfunc.pl b/src/test/modules/ssl_passphrase_callback/t/001_testfunc.pl
index 891e7f63e04..c16ff257180 100644
--- a/src/test/modules/ssl_passphrase_callback/t/001_testfunc.pl
+++ b/src/test/modules/ssl_passphrase_callback/t/001_testfunc.pl
@@ -62,9 +62,11 @@ like(
$node->append_conf('postgresql.conf', "ssl_passphrase.passphrase = 'blurfl'");
# try to start the server again
-my $ret =
- PostgreSQL::Test::Utils::system_log('pg_ctl', '-D', $node->data_dir, '-l',
- $node->logfile, 'start');
+my $ret = PostgreSQL::Test::Utils::system_log(
+ 'pg_ctl',
+ '--pgdata' => $node->data_dir,
+ '--log' => $node->logfile,
+ 'start');
# with a bad passphrase the server should not start
diff --git a/src/test/modules/test_pg_dump/t/001_base.pl b/src/test/modules/test_pg_dump/t/001_base.pl
index 9b2a90b0469..7116e5b8df6 100644
--- a/src/test/modules/test_pg_dump/t/001_base.pl
+++ b/src/test/modules/test_pg_dump/t/001_base.pl
@@ -47,131 +47,149 @@ my %pgdump_runs = (
binary_upgrade => {
dump_cmd => [
'pg_dump', '--no-sync',
- "--file=$tempdir/binary_upgrade.sql", '--schema-only',
- '--binary-upgrade', '--dbname=postgres',
+ '--file' => "$tempdir/binary_upgrade.sql",
+ '--schema-only', '--binary-upgrade',
+ '--dbname' => 'postgres',
],
},
clean => {
dump_cmd => [
- 'pg_dump', "--file=$tempdir/clean.sql",
- '-c', '--no-sync',
- '--dbname=postgres',
+ 'pg_dump', '--no-sync',
+ '--file' => "$tempdir/clean.sql",
+ '--clean',
+ '--dbname' => 'postgres',
],
},
clean_if_exists => {
dump_cmd => [
- 'pg_dump',
- '--no-sync',
- "--file=$tempdir/clean_if_exists.sql",
- '-c',
+ 'pg_dump', '--no-sync',
+ '--file' => "$tempdir/clean_if_exists.sql",
+ '--clean',
'--if-exists',
- '--encoding=UTF8', # no-op, just tests that option is accepted
+ '--encoding' => 'UTF8', # no-op, just tests that it is accepted
'postgres',
],
},
createdb => {
dump_cmd => [
- 'pg_dump',
- '--no-sync',
- "--file=$tempdir/createdb.sql",
- '-C',
- '-R', # no-op, just for testing
+ 'pg_dump', '--no-sync',
+ '--file' => "$tempdir/createdb.sql",
+ '--create',
+ '--no-reconnect', # no-op, just for testing
'postgres',
],
},
data_only => {
dump_cmd => [
- 'pg_dump',
- '--no-sync',
- "--file=$tempdir/data_only.sql",
- '-a',
- '-v', # no-op, just make sure it works
+ 'pg_dump', '--no-sync',
+ '--file' => "$tempdir/data_only.sql",
+ '--data-only',
+ '--verbose', # no-op, just make sure it works
'postgres',
],
},
defaults => {
- dump_cmd => [ 'pg_dump', '-f', "$tempdir/defaults.sql", 'postgres', ],
+ dump_cmd => [
+ 'pg_dump',
+ '--file' => "$tempdir/defaults.sql",
+ 'postgres',
+ ],
},
defaults_custom_format => {
test_key => 'defaults',
compile_option => 'gzip',
dump_cmd => [
- 'pg_dump', '--no-sync', '-Fc', '-Z6',
- "--file=$tempdir/defaults_custom_format.dump", 'postgres',
+ 'pg_dump', '--no-sync',
+ '--format' => 'custom',
+ '--compress' => 6,
+ '--file' => "$tempdir/defaults_custom_format.dump",
+ 'postgres',
],
restore_cmd => [
'pg_restore',
- "--file=$tempdir/defaults_custom_format.sql",
+ '--file' => "$tempdir/defaults_custom_format.sql",
"$tempdir/defaults_custom_format.dump",
],
},
defaults_dir_format => {
test_key => 'defaults',
dump_cmd => [
- 'pg_dump', '--no-sync', '-Fd',
- "--file=$tempdir/defaults_dir_format", 'postgres',
+ 'pg_dump', '--no-sync',
+ '--format' => 'directory',
+ '--file' => "$tempdir/defaults_dir_format",
+ 'postgres',
],
restore_cmd => [
'pg_restore',
- "--file=$tempdir/defaults_dir_format.sql",
+ '--file' => "$tempdir/defaults_dir_format.sql",
"$tempdir/defaults_dir_format",
],
},
defaults_parallel => {
test_key => 'defaults',
dump_cmd => [
- 'pg_dump', '--no-sync', '-Fd', '-j2',
- "--file=$tempdir/defaults_parallel", 'postgres',
+ 'pg_dump', '--no-sync',
+ '--format' => 'directory',
+ '--jobs' => 2,
+ '--file' => "$tempdir/defaults_parallel",
+ 'postgres',
],
restore_cmd => [
'pg_restore',
- "--file=$tempdir/defaults_parallel.sql",
+ '--file' => "$tempdir/defaults_parallel.sql",
"$tempdir/defaults_parallel",
],
},
defaults_tar_format => {
test_key => 'defaults',
dump_cmd => [
- 'pg_dump', '--no-sync', '-Ft',
- "--file=$tempdir/defaults_tar_format.tar", 'postgres',
+ 'pg_dump', '--no-sync',
+ '--format' => 'tar',
+ '--file' => "$tempdir/defaults_tar_format.tar",
+ 'postgres',
],
restore_cmd => [
'pg_restore',
- "--file=$tempdir/defaults_tar_format.sql",
+ '--file' => "$tempdir/defaults_tar_format.sql",
"$tempdir/defaults_tar_format.tar",
],
},
exclude_table => {
dump_cmd => [
'pg_dump',
- '--exclude-table=regress_table_dumpable',
- "--file=$tempdir/exclude_table.sql",
+ '--exclude-table' => 'regress_table_dumpable',
+ '--file' => "$tempdir/exclude_table.sql",
'postgres',
],
},
extension_schema => {
dump_cmd => [
- 'pg_dump', '--schema=public',
- "--file=$tempdir/extension_schema.sql", 'postgres',
+ 'pg_dump',
+ '--schema' => 'public',
+ '--file' => "$tempdir/extension_schema.sql",
+ 'postgres',
],
},
pg_dumpall_globals => {
dump_cmd => [
'pg_dumpall', '--no-sync',
- "--file=$tempdir/pg_dumpall_globals.sql", '-g',
+ '--file' => "$tempdir/pg_dumpall_globals.sql",
+ '--globals-only',
],
},
no_privs => {
dump_cmd => [
'pg_dump', '--no-sync',
- "--file=$tempdir/no_privs.sql", '-x',
+ '--file' => "$tempdir/no_privs.sql",
+ '--no-privileges',
'postgres',
],
},
no_owner => {
dump_cmd => [
'pg_dump', '--no-sync',
- "--file=$tempdir/no_owner.sql", '-O',
+ '--file' => "$tempdir/no_owner.sql",
+ '--no-owner',
'postgres',
],
},
@@ -181,59 +199,68 @@ my %pgdump_runs = (
privileged_internals => {
dump_cmd => [
'pg_dump', '--no-sync',
- "--file=$tempdir/privileged_internals.sql",
+ '--file' => "$tempdir/privileged_internals.sql",
# these two tables are irrelevant to the test case
- '--exclude-table=regress_pg_dump_schema.external_tab',
- '--exclude-table=regress_pg_dump_schema.extdependtab',
- '--username=regress_dump_login_role', 'postgres',
+ '--exclude-table' => 'regress_pg_dump_schema.external_tab',
+ '--exclude-table' => 'regress_pg_dump_schema.extdependtab',
+ '--username' => 'regress_dump_login_role',
+ 'postgres',
],
},
schema_only => {
dump_cmd => [
- 'pg_dump', '--no-sync', "--file=$tempdir/schema_only.sql",
- '-s', 'postgres',
+ 'pg_dump', '--no-sync',
+ '--file' => "$tempdir/schema_only.sql",
+ '--schema-only', 'postgres',
],
},
section_pre_data => {
dump_cmd => [
'pg_dump', '--no-sync',
- "--file=$tempdir/section_pre_data.sql", '--section=pre-data',
+ '--file' => "$tempdir/section_pre_data.sql",
+ '--section' => 'pre-data',
'postgres',
],
},
section_data => {
dump_cmd => [
'pg_dump', '--no-sync',
- "--file=$tempdir/section_data.sql", '--section=data',
+ '--file' => "$tempdir/section_data.sql",
+ '--section' => 'data',
'postgres',
],
},
section_post_data => {
dump_cmd => [
- 'pg_dump', '--no-sync', "--file=$tempdir/section_post_data.sql",
- '--section=post-data', 'postgres',
+ 'pg_dump', '--no-sync',
+ '--file' => "$tempdir/section_post_data.sql",
+ '--section' => 'post-data',
+ 'postgres',
],
},
with_extension => {
dump_cmd => [
- 'pg_dump', '--no-sync', "--file=$tempdir/with_extension.sql",
- '--extension=test_pg_dump', 'postgres',
+ 'pg_dump', '--no-sync',
+ '--file' => "$tempdir/with_extension.sql",
+ '--extension' => 'test_pg_dump',
+ 'postgres',
],
},
exclude_extension => {
dump_cmd => [
'pg_dump', '--no-sync',
- "--file=$tempdir/exclude_extension.sql",
- '--exclude-extension=test_pg_dump', 'postgres',
+ '--file' => "$tempdir/exclude_extension.sql",
+ '--exclude-extension' => 'test_pg_dump',
+ 'postgres',
],
},
exclude_extension_filter => {
dump_cmd => [
'pg_dump',
'--no-sync',
- "--file=$tempdir/exclude_extension_filter.sql",
- "--filter=$tempdir/exclude_extension_filter.txt",
+ '--file' => "$tempdir/exclude_extension_filter.sql",
+ '--filter' => "$tempdir/exclude_extension_filter.txt",
'postgres',
],
},
@@ -241,8 +268,10 @@ my %pgdump_runs = (
# plpgsql in the list blocks the dump of extension test_pg_dump
without_extension => {
dump_cmd => [
- 'pg_dump', '--no-sync', "--file=$tempdir/without_extension.sql",
- '--extension=plpgsql', 'postgres',
+ 'pg_dump', '--no-sync',
+ '--file' => "$tempdir/without_extension.sql",
+ '--extension' => 'plpgsql',
+ 'postgres',
],
},
@@ -253,9 +282,9 @@ my %pgdump_runs = (
dump_cmd => [
'pg_dump',
'--no-sync',
- "--file=$tempdir/without_extension_explicit_schema.sql",
- '--extension=plpgsql',
- '--schema=public',
+ '--file' => "$tempdir/without_extension_explicit_schema.sql",
+ '--extension' => 'plpgsql',
+ '--schema' => 'public',
'postgres',
],
},
@@ -267,9 +296,9 @@ my %pgdump_runs = (
dump_cmd => [
'pg_dump',
'--no-sync',
- "--file=$tempdir/without_extension_internal_schema.sql",
- '--extension=plpgsql',
- '--schema=regress_pg_dump_schema',
+ '--file' => "$tempdir/without_extension_internal_schema.sql",
+ '--extension' => 'plpgsql',
+ '--schema' => 'regress_pg_dump_schema',
'postgres',
],
},);
@@ -840,7 +869,7 @@ my %tests = (
# Create a PG instance to test actually dumping from
my $node = PostgreSQL::Test::Cluster->new('main');
-$node->init('auth_extra' => [ '--create-role', 'regress_dump_login_role' ]);
+$node->init('auth_extra' => [ '--create-role' => 'regress_dump_login_role' ]);
$node->start;
my $port = $node->port;
diff --git a/src/test/perl/PostgreSQL/Test/BackgroundPsql.pm b/src/test/perl/PostgreSQL/Test/BackgroundPsql.pm
index c611a61cf4e..60bbd5dd445 100644
--- a/src/test/perl/PostgreSQL/Test/BackgroundPsql.pm
+++ b/src/test/perl/PostgreSQL/Test/BackgroundPsql.pm
@@ -108,14 +108,17 @@ sub new
if ($interactive)
{
$run = IPC::Run::start $psql_params,
- '<pty<', \$psql->{stdin}, '>pty>', \$psql->{stdout}, '2>',
- \$psql->{stderr},
+ '<pty<' => \$psql->{stdin},
+ '>pty>' => \$psql->{stdout},
+ '2>' => \$psql->{stderr},
$psql->{timeout};
}
else
{
$run = IPC::Run::start $psql_params,
- '<', \$psql->{stdin}, '>', \$psql->{stdout}, '2>', \$psql->{stderr},
+ '<' => \$psql->{stdin},
+ '>' => \$psql->{stdout},
+ '2>' => \$psql->{stderr},
$psql->{timeout};
}
diff --git a/src/test/perl/PostgreSQL/Test/Cluster.pm b/src/test/perl/PostgreSQL/Test/Cluster.pm
index b105cba05a6..0750915a9a8 100644
--- a/src/test/perl/PostgreSQL/Test/Cluster.pm
+++ b/src/test/perl/PostgreSQL/Test/Cluster.pm
@@ -640,8 +640,11 @@ sub init
or !defined $ENV{INITDB_TEMPLATE})
{
note("initializing database system by running initdb");
- PostgreSQL::Test::Utils::system_or_bail('initdb', '-D', $pgdata, '-A',
- 'trust', '-N', @{ $params{extra} });
+ PostgreSQL::Test::Utils::system_or_bail(
+ 'initdb', '--no-sync',
+ '--pgdata' => $pgdata,
+ '--auth' => 'trust',
+ @{ $params{extra} });
}
else
{
@@ -838,11 +841,11 @@ sub backup
print "# Taking pg_basebackup $backup_name from node \"$name\"\n";
PostgreSQL::Test::Utils::system_or_bail(
- 'pg_basebackup', '-D',
- $backup_path, '-h',
- $self->host, '-p',
- $self->port, '--checkpoint',
- 'fast', '--no-sync',
+ 'pg_basebackup', '--no-sync',
+ '--pgdata' => $backup_path,
+ '--host' => $self->host,
+ '--port' => $self->port,
+ '--checkpoint' => 'fast',
@{ $params{backup_options} });
print "# Backup finished\n";
return;
@@ -946,7 +949,7 @@ sub init_from_backup
}
local %ENV = $self->_get_env();
- my @combineargs = ('pg_combinebackup', '-d');
+ my @combineargs = ('pg_combinebackup', '--debug');
if (exists $params{tablespace_map})
{
while (my ($olddir, $newdir) = each %{ $params{tablespace_map} })
@@ -959,19 +962,21 @@ sub init_from_backup
{
push @combineargs, $params{combine_mode};
}
- push @combineargs, @prior_backup_path, $backup_path, '-o', $data_path;
+ push @combineargs, @prior_backup_path, $backup_path,
+ '--output' => $data_path;
PostgreSQL::Test::Utils::system_or_bail(@combineargs);
}
elsif (defined $params{tar_program})
{
mkdir($data_path) || die "mkdir $data_path: $!";
- PostgreSQL::Test::Utils::system_or_bail($params{tar_program}, 'xf',
- $backup_path . '/base.tar',
- '-C', $data_path);
PostgreSQL::Test::Utils::system_or_bail(
- $params{tar_program}, 'xf',
- $backup_path . '/pg_wal.tar', '-C',
- $data_path . '/pg_wal');
+ $params{tar_program},
+ 'xf' => $backup_path . '/base.tar',
+ '-C' => $data_path);
+ PostgreSQL::Test::Utils::system_or_bail(
+ $params{tar_program},
+ 'xf' => $backup_path . '/pg_wal.tar',
+ '-C' => $data_path . '/pg_wal');
# We need to generate a tablespace_map file.
open(my $tsmap, ">", "$data_path/tablespace_map")
@@ -991,9 +996,10 @@ sub init_from_backup
my $newdir = $params{tablespace_map}{$tsoid};
mkdir($newdir) || die "mkdir $newdir: $!";
- PostgreSQL::Test::Utils::system_or_bail($params{tar_program},
- 'xf', $backup_path . '/' . $tstar,
- '-C', $newdir);
+ PostgreSQL::Test::Utils::system_or_bail(
+ $params{tar_program},
+ 'xf' => $backup_path . '/' . $tstar,
+ '-C' => $newdir);
my $escaped_newdir = $newdir;
$escaped_newdir =~ s/\\/\\\\/g;
@@ -1133,8 +1139,10 @@ sub start
# -w is now the default but having it here does no harm and helps
# compatibility with older versions.
$ret = PostgreSQL::Test::Utils::system_log(
- 'pg_ctl', '-w', '-D', $self->data_dir,
- '-l', $self->logfile, '-o', "--cluster-name=$name",
+ 'pg_ctl', '--wait',
+ '--pgdata' => $self->data_dir,
+ '--log' => $self->logfile,
+ '--options' => "--cluster-name=$name",
'start');
if ($ret != 0)
@@ -1211,10 +1219,10 @@ sub stop
return 1 unless defined $self->{_pid};
print "### Stopping node \"$name\" using mode $mode\n";
- my @cmd = ('pg_ctl', '-D', $pgdata, '-m', $mode, 'stop');
+ my @cmd = ('pg_ctl', '--pgdata' => $pgdata, '--mode' => $mode, 'stop');
if ($params{timeout})
{
- push(@cmd, ('--timeout', $params{timeout}));
+ push(@cmd, ('--timeout' => $params{timeout}));
}
$ret = PostgreSQL::Test::Utils::system_log(@cmd);
@@ -1251,7 +1259,9 @@ sub reload
local %ENV = $self->_get_env();
print "### Reloading node \"$name\"\n";
- PostgreSQL::Test::Utils::system_or_bail('pg_ctl', '-D', $pgdata,
+ PostgreSQL::Test::Utils::system_or_bail(
+ 'pg_ctl',
+ '--pgdata' => $pgdata,
'reload');
return;
}
@@ -1279,8 +1289,11 @@ sub restart
# -w is now the default but having it here does no harm and helps
# compatibility with older versions.
- $ret = PostgreSQL::Test::Utils::system_log('pg_ctl', '-w', '-D',
- $self->data_dir, '-l', $self->logfile, 'restart');
+ $ret = PostgreSQL::Test::Utils::system_log(
+ 'pg_ctl', '--wait',
+ '--pgdata' => $self->data_dir,
+ '--log' => $self->logfile,
+ 'restart');
if ($ret != 0)
{
@@ -1318,8 +1331,11 @@ sub promote
local %ENV = $self->_get_env();
print "### Promoting node \"$name\"\n";
- PostgreSQL::Test::Utils::system_or_bail('pg_ctl', '-D', $pgdata, '-l',
- $logfile, 'promote');
+ PostgreSQL::Test::Utils::system_or_bail(
+ 'pg_ctl',
+ '--pgdata' => $pgdata,
+ '--log' => $logfile,
+ 'promote');
return;
}
@@ -1342,8 +1358,11 @@ sub logrotate
local %ENV = $self->_get_env();
print "### Rotating log in node \"$name\"\n";
- PostgreSQL::Test::Utils::system_or_bail('pg_ctl', '-D', $pgdata, '-l',
- $logfile, 'logrotate');
+ PostgreSQL::Test::Utils::system_or_bail(
+ 'pg_ctl',
+ '--pgdata' => $pgdata,
+ '--log' => $logfile,
+ 'logrotate');
return;
}
@@ -2120,7 +2139,9 @@ sub psql
my @psql_params = (
$self->installed_command('psql'),
- '-XAtq', '-d', $psql_connstr, '-f', '-');
+ '--no-psqlrc', '--no-align', '--tuples-only', '--quiet',
+ '--dbname' => $psql_connstr,
+ '--file' => '-');
# If the caller wants an array and hasn't passed stdout/stderr
# references, allocate temporary ones to capture them so we
@@ -2142,7 +2163,8 @@ sub psql
$params{on_error_stop} = 1 unless defined $params{on_error_stop};
$params{on_error_die} = 0 unless defined $params{on_error_die};
- push @psql_params, '-v', 'ON_ERROR_STOP=1' if $params{on_error_stop};
+ push @psql_params, '--variable' => 'ON_ERROR_STOP=1'
+ if $params{on_error_stop};
push @psql_params, @{ $params{extra_params} }
if defined $params{extra_params};
@@ -2168,9 +2190,9 @@ sub psql
{
local $@;
eval {
- my @ipcrun_opts = (\@psql_params, '<', \$sql);
- push @ipcrun_opts, '>', $stdout if defined $stdout;
- push @ipcrun_opts, '2>', $stderr if defined $stderr;
+ my @ipcrun_opts = (\@psql_params, '<' => \$sql);
+ push @ipcrun_opts, '>' => $stdout if defined $stdout;
+ push @ipcrun_opts, '2>' => $stderr if defined $stderr;
push @ipcrun_opts, $timeout if defined $timeout;
IPC::Run::run @ipcrun_opts;
@@ -2325,13 +2347,16 @@ sub background_psql
my @psql_params = (
$self->installed_command('psql'),
- '-XAtq', '-d', $psql_connstr, '-f', '-');
+ '--no-psqlrc', '--no-align',
+ '--tuples-only', '--quiet',
+ '--dbname' => $psql_connstr,
+ '--file' => '-');
$params{on_error_stop} = 1 unless defined $params{on_error_stop};
$params{wait} = 1 unless defined $params{wait};
$timeout = $params{timeout} if defined $params{timeout};
- push @psql_params, '-v', 'ON_ERROR_STOP=1' if $params{on_error_stop};
+ push @psql_params, '--set' => 'ON_ERROR_STOP=1' if $params{on_error_stop};
push @psql_params, @{ $params{extra_params} }
if defined $params{extra_params};
@@ -2402,7 +2427,8 @@ sub interactive_psql
my @psql_params = (
$self->installed_command('psql'),
- '-XAt', '-d', $self->connstr($dbname));
+ '--no-psqlrc', '--no-align', '--tuples-only',
+ '--dbname' => $self->connstr($dbname));
push @psql_params, @{ $params{extra_params} }
if defined $params{extra_params};
@@ -2424,7 +2450,7 @@ sub _pgbench_make_files
for my $fn (sort keys %$files)
{
my $filename = $self->basedir . '/' . $fn;
- push @file_opts, '-f', $filename;
+ push @file_opts, '--file' => $filename;
# cleanup file weight
$filename =~ s/\@\d+$//;
@@ -2650,8 +2676,9 @@ sub poll_query_until
$expected = 't' unless defined($expected); # default value
my $cmd = [
- $self->installed_command('psql'), '-XAt',
- '-d', $self->connstr($dbname)
+ $self->installed_command('psql'), '--no-psqlrc',
+ '--no-align', '--tuples-only',
+ '--dbname' => $self->connstr($dbname)
];
my ($stdout, $stderr);
my $max_attempts = 10 * $PostgreSQL::Test::Utils::timeout_default;
@@ -2659,8 +2686,10 @@ sub poll_query_until
while ($attempts < $max_attempts)
{
- my $result = IPC::Run::run $cmd, '<', \$query,
- '>', \$stdout, '2>', \$stderr;
+ my $result = IPC::Run::run $cmd,
+ '<' => \$query,
+ '>' => \$stdout,
+ '2>' => \$stderr;
chomp($stdout);
chomp($stderr);
@@ -3534,15 +3563,17 @@ sub pg_recvlogical_upto
my @cmd = (
$self->installed_command('pg_recvlogical'),
- '-S', $slot_name, '--dbname', $self->connstr($dbname));
- push @cmd, '--endpos', $endpos;
- push @cmd, '-f', '-', '--no-loop', '--start';
+ '--slot' => $slot_name,
+ '--dbname' => $self->connstr($dbname),
+ '--endpos' => $endpos,
+ '--file' => '-',
+ '--no-loop', '--start');
while (my ($k, $v) = each %plugin_options)
{
croak "= is not permitted to appear in replication option name"
if ($k =~ qr/=/);
- push @cmd, "-o", "$k=$v";
+ push @cmd, "--option" => "$k=$v";
}
my $timeout;
@@ -3555,7 +3586,7 @@ sub pg_recvlogical_upto
{
local $@;
eval {
- IPC::Run::run(\@cmd, ">", \$stdout, "2>", \$stderr, $timeout);
+ IPC::Run::run(\@cmd, '>' => \$stdout, '2>' => \$stderr, $timeout);
$ret = $?;
};
my $exc_save = $@;
@@ -3669,15 +3700,14 @@ sub create_logical_slot_on_standby
$handle = IPC::Run::start(
[
- 'pg_recvlogical', '-d',
- $self->connstr($dbname), '-P',
- 'test_decoding', '-S',
- $slot_name, '--create-slot'
+ 'pg_recvlogical',
+ '--dbname' => $self->connstr($dbname),
+ '--plugin' => 'test_decoding',
+ '--slot' => $slot_name,
+ '--create-slot'
],
- '>',
- \$stdout,
- '2>',
- \$stderr);
+ '>' => \$stdout,
+ '2>' => \$stderr);
# Arrange for the xl_running_xacts record for which pg_recvlogical is
# waiting.
diff --git a/src/test/perl/PostgreSQL/Test/Kerberos.pm b/src/test/perl/PostgreSQL/Test/Kerberos.pm
index 118ea1e103e..b72dd2fbaf4 100644
--- a/src/test/perl/PostgreSQL/Test/Kerberos.pm
+++ b/src/test/perl/PostgreSQL/Test/Kerberos.pm
@@ -104,7 +104,7 @@ sub new
my ($host, $hostaddr, $realm) = @_;
my ($stdout, $krb5_version);
- run_log [ $krb5_config, '--version' ], '>', \$stdout
+ run_log [ $krb5_config, '--version' ], '>' => \$stdout
or BAIL_OUT("could not execute krb5-config");
BAIL_OUT("Heimdal is not supported") if $stdout =~ m/heimdal/;
$stdout =~ m/Kerberos 5 release ([0-9]+\.[0-9]+)/
diff --git a/src/test/perl/PostgreSQL/Test/Utils.pm b/src/test/perl/PostgreSQL/Test/Utils.pm
index efe0321a4ef..d1ad131eadf 100644
--- a/src/test/perl/PostgreSQL/Test/Utils.pm
+++ b/src/test/perl/PostgreSQL/Test/Utils.pm
@@ -20,7 +20,7 @@ PostgreSQL::Test::Utils - helper module for writing PostgreSQL's C<prove> tests.
command_fails(['initdb', '--invalid-option'],
'command fails with invalid option');
my $tempdir = PostgreSQL::Test::Utils::tempdir;
- command_ok('initdb', '-D', $tempdir);
+ command_ok('initdb', '--pgdata' => $tempdir);
# Miscellanea
print "on Windows" if $PostgreSQL::Test::Utils::windows_os;
@@ -333,7 +333,7 @@ sub has_wal_read_bug
return
$Config{osname} eq 'linux'
&& $Config{archname} =~ /^sparc/
- && !run_log([ qw(df -x ext4), $tmp_check ], '>', '/dev/null', '2>&1');
+ && !run_log([ qw(df -x ext4), $tmp_check ], '&>' => '/dev/null');
}
=pod
@@ -419,7 +419,7 @@ sub run_command
{
my ($cmd) = @_;
my ($stdout, $stderr);
- my $result = IPC::Run::run $cmd, '>', \$stdout, '2>', \$stderr;
+ my $result = IPC::Run::run $cmd, '>' => \$stdout, '2>' => \$stderr;
chomp($stdout);
chomp($stderr);
return ($stdout, $stderr);
@@ -723,8 +723,9 @@ sub scan_server_header
my ($header_path, $regexp) = @_;
my ($stdout, $stderr);
- my $result = IPC::Run::run [ 'pg_config', '--includedir-server' ], '>',
- \$stdout, '2>', \$stderr
+ my $result = IPC::Run::run [ 'pg_config', '--includedir-server' ],
+ '>' => \$stdout,
+ '2>' => \$stderr
or die "could not execute pg_config";
chomp($stdout);
$stdout =~ s/\r$//;
@@ -761,8 +762,9 @@ sub check_pg_config
{
my ($regexp) = @_;
my ($stdout, $stderr);
- my $result = IPC::Run::run [ 'pg_config', '--includedir' ], '>',
- \$stdout, '2>', \$stderr
+ my $result = IPC::Run::run [ 'pg_config', '--includedir' ],
+ '>' => \$stdout,
+ '2>' => \$stderr
or die "could not execute pg_config";
chomp($stdout);
$stdout =~ s/\r$//;
@@ -925,8 +927,9 @@ sub program_help_ok
my ($cmd) = @_;
my ($stdout, $stderr);
print("# Running: $cmd --help\n");
- my $result = IPC::Run::run [ $cmd, '--help' ], '>', \$stdout, '2>',
- \$stderr;
+ my $result = IPC::Run::run [ $cmd, '--help' ],
+ '>' => \$stdout,
+ '2>' => \$stderr;
ok($result, "$cmd --help exit code 0");
isnt($stdout, '', "$cmd --help goes to stdout");
is($stderr, '', "$cmd --help nothing to stderr");
@@ -956,8 +959,9 @@ sub program_version_ok
my ($cmd) = @_;
my ($stdout, $stderr);
print("# Running: $cmd --version\n");
- my $result = IPC::Run::run [ $cmd, '--version' ], '>', \$stdout, '2>',
- \$stderr;
+ my $result = IPC::Run::run [ $cmd, '--version' ],
+ '>' => \$stdout,
+ '2>' => \$stderr;
ok($result, "$cmd --version exit code 0");
isnt($stdout, '', "$cmd --version goes to stdout");
is($stderr, '', "$cmd --version nothing to stderr");
@@ -979,9 +983,9 @@ sub program_options_handling_ok
my ($cmd) = @_;
my ($stdout, $stderr);
print("# Running: $cmd --not-a-valid-option\n");
- my $result = IPC::Run::run [ $cmd, '--not-a-valid-option' ], '>',
- \$stdout,
- '2>', \$stderr;
+ my $result = IPC::Run::run [ $cmd, '--not-a-valid-option' ],
+ '>' => \$stdout,
+ '2>' => \$stderr;
ok(!$result, "$cmd with invalid option nonzero exit code");
isnt($stderr, '', "$cmd with invalid option prints error message");
return;
@@ -1002,7 +1006,7 @@ sub command_like
my ($cmd, $expected_stdout, $test_name) = @_;
my ($stdout, $stderr);
print("# Running: " . join(" ", @{$cmd}) . "\n");
- my $result = IPC::Run::run $cmd, '>', \$stdout, '2>', \$stderr;
+ my $result = IPC::Run::run $cmd, '>' => \$stdout, '2>' => \$stderr;
ok($result, "$test_name: exit code 0");
is($stderr, '', "$test_name: no stderr");
like($stdout, $expected_stdout, "$test_name: matches");
@@ -1031,7 +1035,7 @@ sub command_like_safe
my $stdoutfile = File::Temp->new();
my $stderrfile = File::Temp->new();
print("# Running: " . join(" ", @{$cmd}) . "\n");
- my $result = IPC::Run::run $cmd, '>', $stdoutfile, '2>', $stderrfile;
+ my $result = IPC::Run::run $cmd, '>' => $stdoutfile, '2>' => $stderrfile;
$stdout = slurp_file($stdoutfile);
$stderr = slurp_file($stderrfile);
ok($result, "$test_name: exit code 0");
@@ -1055,7 +1059,7 @@ sub command_fails_like
my ($cmd, $expected_stderr, $test_name) = @_;
my ($stdout, $stderr);
print("# Running: " . join(" ", @{$cmd}) . "\n");
- my $result = IPC::Run::run $cmd, '>', \$stdout, '2>', \$stderr;
+ my $result = IPC::Run::run $cmd, '>' => \$stdout, '2>' => \$stderr;
ok(!$result, "$test_name: exit code not 0");
like($stderr, $expected_stderr, "$test_name: matches");
return;
@@ -1093,7 +1097,7 @@ sub command_checks_all
# run command
my ($stdout, $stderr);
print("# Running: " . join(" ", @{$cmd}) . "\n");
- IPC::Run::run($cmd, '>', \$stdout, '2>', \$stderr);
+ IPC::Run::run($cmd, '>' => \$stdout, '2>' => \$stderr);
# See http://perldoc.perl.org/perlvar.html#%24CHILD_ERROR
my $ret = $?;
diff --git a/src/test/postmaster/t/002_connection_limits.pl b/src/test/postmaster/t/002_connection_limits.pl
index fb89a76c005..85f5ef03dec 100644
--- a/src/test/postmaster/t/002_connection_limits.pl
+++ b/src/test/postmaster/t/002_connection_limits.pl
@@ -14,7 +14,8 @@ use Test::More;
my $node = PostgreSQL::Test::Cluster->new('primary');
$node->init(
'auth_extra' => [
- '--create-role', 'regress_regular,regress_reserved,regress_superuser'
+ '--create-role' =>
+ 'regress_regular,regress_reserved,regress_superuser',
]);
$node->append_conf('postgresql.conf', "max_connections = 6");
$node->append_conf('postgresql.conf', "reserved_connections = 2");
@@ -43,7 +44,7 @@ sub background_psql_as_user
return $node->background_psql(
'postgres',
on_error_die => 1,
- extra_params => [ '-U', $user ]);
+ extra_params => [ '--username' => $user ]);
}
# Like connect_fails(), except that we also wait for the failed backend to
diff --git a/src/test/recovery/t/001_stream_rep.pl b/src/test/recovery/t/001_stream_rep.pl
index 3945f00ab88..ccd8417d449 100644
--- a/src/test/recovery/t/001_stream_rep.pl
+++ b/src/test/recovery/t/001_stream_rep.pl
@@ -14,7 +14,7 @@ my $node_primary = PostgreSQL::Test::Cluster->new('primary');
# and it needs proper authentication configuration.
$node_primary->init(
allows_streaming => 1,
- auth_extra => [ '--create-role', 'repl_role' ]);
+ auth_extra => [ '--create-role' => 'repl_role' ]);
$node_primary->start;
my $backup_name = 'my_backup';
@@ -146,9 +146,13 @@ sub test_target_session_attrs
# we connected to. Note we must pass the SQL command via the command
# line not stdin, else Perl may spit up trying to write to stdin of
# an already-failed psql process.
- my ($ret, $stdout, $stderr) =
- $node1->psql('postgres', undef,
- extra_params => [ '-d', $connstr, '-c', 'SHOW port;' ]);
+ my ($ret, $stdout, $stderr) = $node1->psql(
+ 'postgres',
+ undef,
+ extra_params => [
+ '--dbname' => $connstr,
+ '--command' => 'SHOW port;',
+ ]);
if ($status == 0)
{
is( $status == $ret && $stdout eq $target_port,
@@ -257,26 +261,26 @@ my $connstr_db = "$connstr_common replication=database dbname=postgres";
my ($ret, $stdout, $stderr) = $node_primary->psql(
'postgres', 'SHOW ALL;',
on_error_die => 1,
- extra_params => [ '-d', $connstr_rep ]);
+ extra_params => [ '--dbname' => $connstr_rep ]);
ok($ret == 0, "SHOW ALL with replication role and physical replication");
($ret, $stdout, $stderr) = $node_primary->psql(
'postgres', 'SHOW ALL;',
on_error_die => 1,
- extra_params => [ '-d', $connstr_db ]);
+ extra_params => [ '--dbname' => $connstr_db ]);
ok($ret == 0, "SHOW ALL with replication role and logical replication");
# Test SHOW with a user-settable parameter
($ret, $stdout, $stderr) = $node_primary->psql(
'postgres', 'SHOW work_mem;',
on_error_die => 1,
- extra_params => [ '-d', $connstr_rep ]);
+ extra_params => [ '--dbname' => $connstr_rep ]);
ok( $ret == 0,
"SHOW with user-settable parameter, replication role and physical replication"
);
($ret, $stdout, $stderr) = $node_primary->psql(
'postgres', 'SHOW work_mem;',
on_error_die => 1,
- extra_params => [ '-d', $connstr_db ]);
+ extra_params => [ '--dbname' => $connstr_db ]);
ok( $ret == 0,
"SHOW with user-settable parameter, replication role and logical replication"
);
@@ -285,14 +289,14 @@ ok( $ret == 0,
($ret, $stdout, $stderr) = $node_primary->psql(
'postgres', 'SHOW primary_conninfo;',
on_error_die => 1,
- extra_params => [ '-d', $connstr_rep ]);
+ extra_params => [ '--dbname' => $connstr_rep ]);
ok( $ret == 0,
"SHOW with superuser-settable parameter, replication role and physical replication"
);
($ret, $stdout, $stderr) = $node_primary->psql(
'postgres', 'SHOW primary_conninfo;',
on_error_die => 1,
- extra_params => [ '-d', $connstr_db ]);
+ extra_params => [ '--dbname' => $connstr_db ]);
ok( $ret == 0,
"SHOW with superuser-settable parameter, replication role and logical replication"
);
@@ -304,7 +308,7 @@ my $slotname = 'test_read_replication_slot_physical';
($ret, $stdout, $stderr) = $node_primary->psql(
'postgres',
'READ_REPLICATION_SLOT non_existent_slot;',
- extra_params => [ '-d', $connstr_rep ]);
+ extra_params => [ '--dbname' => $connstr_rep ]);
ok($ret == 0, "READ_REPLICATION_SLOT exit code 0 on success");
like($stdout, qr/^\|\|$/,
"READ_REPLICATION_SLOT returns NULL values if slot does not exist");
@@ -312,12 +316,12 @@ like($stdout, qr/^\|\|$/,
$node_primary->psql(
'postgres',
"CREATE_REPLICATION_SLOT $slotname PHYSICAL RESERVE_WAL;",
- extra_params => [ '-d', $connstr_rep ]);
+ extra_params => [ '--dbname' => $connstr_rep ]);
($ret, $stdout, $stderr) = $node_primary->psql(
'postgres',
"READ_REPLICATION_SLOT $slotname;",
- extra_params => [ '-d', $connstr_rep ]);
+ extra_params => [ '--dbname' => $connstr_rep ]);
ok($ret == 0, "READ_REPLICATION_SLOT success with existing slot");
like($stdout, qr/^physical\|[^|]*\|1$/,
"READ_REPLICATION_SLOT returns tuple with slot information");
@@ -325,7 +329,7 @@ like($stdout, qr/^physical\|[^|]*\|1$/,
$node_primary->psql(
'postgres',
"DROP_REPLICATION_SLOT $slotname;",
- extra_params => [ '-d', $connstr_rep ]);
+ extra_params => [ '--dbname' => $connstr_rep ]);
note "switching to physical replication slot";
@@ -594,16 +598,14 @@ my $sigchld_bb_timeout =
my ($sigchld_bb_stdin, $sigchld_bb_stdout, $sigchld_bb_stderr) = ('', '', '');
my $sigchld_bb = IPC::Run::start(
[
- 'psql', '-X', '-c', "BASE_BACKUP (CHECKPOINT 'fast', MAX_RATE 32);",
- '-c', 'SELECT pg_backup_stop()',
- '-d', $connstr
+ 'psql', '--no-psqlrc',
+ '--command' => "BASE_BACKUP (CHECKPOINT 'fast', MAX_RATE 32);",
+ '--command' => 'SELECT pg_backup_stop()',
+ '--dbname' => $connstr
],
- '<',
- \$sigchld_bb_stdin,
- '>',
- \$sigchld_bb_stdout,
- '2>',
- \$sigchld_bb_stderr,
+ '<' => \$sigchld_bb_stdin,
+ '>' => \$sigchld_bb_stdout,
+ '2>' => \$sigchld_bb_stderr,
$sigchld_bb_timeout);
# The cancellation is issued once the database files are streamed and
diff --git a/src/test/recovery/t/006_logical_decoding.pl b/src/test/recovery/t/006_logical_decoding.pl
index 9f469101fd4..a5678bc4dc4 100644
--- a/src/test/recovery/t/006_logical_decoding.pl
+++ b/src/test/recovery/t/006_logical_decoding.pl
@@ -149,8 +149,11 @@ SKIP:
my $pg_recvlogical = IPC::Run::start(
[
- 'pg_recvlogical', '-d', $node_primary->connstr('otherdb'),
- '-S', 'otherdb_slot', '-f', '-', '--start'
+ 'pg_recvlogical',
+ '--dbname' => $node_primary->connstr('otherdb'),
+ '--slot' => 'otherdb_slot',
+ '--file' => '-',
+ '--start'
]);
$node_primary->poll_query_until('otherdb',
"SELECT EXISTS (SELECT 1 FROM pg_replication_slots WHERE slot_name = 'otherdb_slot' AND active_pid IS NOT NULL)"
diff --git a/src/test/recovery/t/013_crash_restart.pl b/src/test/recovery/t/013_crash_restart.pl
index cd848918d00..4e60806563f 100644
--- a/src/test/recovery/t/013_crash_restart.pl
+++ b/src/test/recovery/t/013_crash_restart.pl
@@ -34,30 +34,27 @@ $node->safe_psql(
my ($killme_stdin, $killme_stdout, $killme_stderr) = ('', '', '');
my $killme = IPC::Run::start(
[
- 'psql', '-X', '-qAt', '-v', 'ON_ERROR_STOP=1', '-f', '-', '-d',
- $node->connstr('postgres')
+ 'psql', '--no-psqlrc', '--quiet', '--no-align', '--tuples-only',
+ '--set' => 'ON_ERROR_STOP=1',
+ '--file' => '-',
+ '--dbname' => $node->connstr('postgres')
],
- '<',
- \$killme_stdin,
- '>',
- \$killme_stdout,
- '2>',
- \$killme_stderr,
+ '<' => \$killme_stdin,
+ '>' => \$killme_stdout,
+ '2>' => \$killme_stderr,
$psql_timeout);
# Need a second psql to check if crash-restart happened.
my ($monitor_stdin, $monitor_stdout, $monitor_stderr) = ('', '', '');
my $monitor = IPC::Run::start(
[
- 'psql', '-X', '-qAt', '-v', 'ON_ERROR_STOP=1', '-f', '-', '-d',
- $node->connstr('postgres')
+ 'psql', '--no-psqlrc', '--quiet', '--no-align', '--tuples-only',
+ '--set' => 'ON_ERROR_STOP=1',
+ '--file', '-', '--dbname' => $node->connstr('postgres')
],
- '<',
- \$monitor_stdin,
- '>',
- \$monitor_stdout,
- '2>',
- \$monitor_stderr,
+ '<' => \$monitor_stdin,
+ '>' => \$monitor_stdout,
+ '2>' => \$monitor_stderr,
$psql_timeout);
#create table, insert row that should survive
diff --git a/src/test/recovery/t/017_shm.pl b/src/test/recovery/t/017_shm.pl
index e2e85d471fe..c73aa3f0c2c 100644
--- a/src/test/recovery/t/017_shm.pl
+++ b/src/test/recovery/t/017_shm.pl
@@ -29,11 +29,11 @@ my $tempdir = PostgreSQL::Test::Utils::tempdir;
# Log "ipcs" diffs on a best-effort basis, swallowing any error.
my $ipcs_before = "$tempdir/ipcs_before";
-eval { run_log [ 'ipcs', '-am' ], '>', $ipcs_before; };
+eval { run_log [ 'ipcs', '-am' ], '>' => $ipcs_before; };
sub log_ipcs
{
- eval { run_log [ 'ipcs', '-am' ], '|', [ 'diff', $ipcs_before, '-' ] };
+ eval { run_log [ 'ipcs', '-am' ], '|' => [ 'diff', $ipcs_before, '-' ] };
return;
}
@@ -122,15 +122,13 @@ my $slow_query = 'SELECT wait_pid(pg_backend_pid())';
my ($stdout, $stderr);
my $slow_client = IPC::Run::start(
[
- 'psql', '-X', '-qAt', '-d', $gnat->connstr('postgres'),
- '-c', $slow_query
+ 'psql', '--no-psqlrc', '--quiet', '--no-align', '--tuples-only',
+ '--dbname' => $gnat->connstr('postgres'),
+ '--command' => $slow_query
],
- '<',
- \undef,
- '>',
- \$stdout,
- '2>',
- \$stderr,
+ '<' => \undef,
+ '>' => \$stdout,
+ '2>' => \$stderr,
IPC::Run::timeout(5 * $PostgreSQL::Test::Utils::timeout_default));
ok( $gnat->poll_query_until(
'postgres',
diff --git a/src/test/recovery/t/021_row_visibility.pl b/src/test/recovery/t/021_row_visibility.pl
index 53c0d108a3a..42740745bfd 100644
--- a/src/test/recovery/t/021_row_visibility.pl
+++ b/src/test/recovery/t/021_row_visibility.pl
@@ -38,24 +38,26 @@ my $psql_timeout =
# to check uncommitted changes being replicated and such.
my %psql_primary = (stdin => '', stdout => '', stderr => '');
$psql_primary{run} = IPC::Run::start(
- [ 'psql', '-XA', '-f', '-', '-d', $node_primary->connstr('postgres') ],
- '<',
- \$psql_primary{stdin},
- '>',
- \$psql_primary{stdout},
- '2>',
- \$psql_primary{stderr},
+ [
+ 'psql', '--no-psqlrc', '--no-align',
+ '--file' => '-',
+ '--dbname' => $node_primary->connstr('postgres'),
+ ],
+ '<' => \$psql_primary{stdin},
+ '>' => \$psql_primary{stdout},
+ '2>' => \$psql_primary{stderr},
$psql_timeout);
my %psql_standby = ('stdin' => '', 'stdout' => '', 'stderr' => '');
$psql_standby{run} = IPC::Run::start(
- [ 'psql', '-XA', '-f', '-', '-d', $node_standby->connstr('postgres') ],
- '<',
- \$psql_standby{stdin},
- '>',
- \$psql_standby{stdout},
- '2>',
- \$psql_standby{stderr},
+ [
+ 'psql', '--no-psqlrc', '--no-align',
+ '--file' => '-',
+ '--dbname' => $node_standby->connstr('postgres'),
+ ],
+ '<' => \$psql_standby{stdin},
+ '>' => \$psql_standby{stdout},
+ '2>' => \$psql_standby{stderr},
$psql_timeout);
#
diff --git a/src/test/recovery/t/022_crash_temp_files.pl b/src/test/recovery/t/022_crash_temp_files.pl
index 483a416723f..50def031c96 100644
--- a/src/test/recovery/t/022_crash_temp_files.pl
+++ b/src/test/recovery/t/022_crash_temp_files.pl
@@ -38,15 +38,14 @@ $node->safe_psql('postgres', q[CREATE TABLE tab_crash (a integer UNIQUE);]);
my ($killme_stdin, $killme_stdout, $killme_stderr) = ('', '', '');
my $killme = IPC::Run::start(
[
- 'psql', '-X', '-qAt', '-v', 'ON_ERROR_STOP=1', '-f', '-', '-d',
- $node->connstr('postgres')
+ 'psql', '--no-psqlrc', '--quiet', '--no-align', '--tuples-only',
+ '--set' => 'ON_ERROR_STOP=1',
+ '--file' => '-',
+ '--dbname' => $node->connstr('postgres')
],
- '<',
- \$killme_stdin,
- '>',
- \$killme_stdout,
- '2>',
- \$killme_stderr,
+ '<' => \$killme_stdin,
+ '>' => \$killme_stdout,
+ '2>' => \$killme_stderr,
$psql_timeout);
# Get backend pid
@@ -66,15 +65,14 @@ $killme_stderr = '';
my ($killme_stdin2, $killme_stdout2, $killme_stderr2) = ('', '', '');
my $killme2 = IPC::Run::start(
[
- 'psql', '-X', '-qAt', '-v', 'ON_ERROR_STOP=1', '-f', '-', '-d',
- $node->connstr('postgres')
+ 'psql', '--no-psqlrc', '--quiet', '--no-align', '--tuples-only',
+ '--set' => 'ON_ERROR_STOP=1',
+ '--file' => '-',
+ '--dbname' => $node->connstr('postgres')
],
- '<',
- \$killme_stdin2,
- '>',
- \$killme_stdout2,
- '2>',
- \$killme_stderr2,
+ '<' => \$killme_stdin2,
+ '>' => \$killme_stdout2,
+ '2>' => \$killme_stderr2,
$psql_timeout);
# Insert one tuple and leave the transaction open
diff --git a/src/test/recovery/t/032_relfilenode_reuse.pl b/src/test/recovery/t/032_relfilenode_reuse.pl
index ddb7223b337..492ef115ba4 100644
--- a/src/test/recovery/t/032_relfilenode_reuse.pl
+++ b/src/test/recovery/t/032_relfilenode_reuse.pl
@@ -36,24 +36,26 @@ my $psql_timeout = IPC::Run::timer($PostgreSQL::Test::Utils::timeout_default);
my %psql_primary = (stdin => '', stdout => '', stderr => '');
$psql_primary{run} = IPC::Run::start(
- [ 'psql', '-XA', '-f', '-', '-d', $node_primary->connstr('postgres') ],
- '<',
- \$psql_primary{stdin},
- '>',
- \$psql_primary{stdout},
- '2>',
- \$psql_primary{stderr},
+ [
+ 'psql', '--no-psqlrc', '--no-align',
+ '--file' => '-',
+ '--dbname' => $node_primary->connstr('postgres')
+ ],
+ '<' => \$psql_primary{stdin},
+ '>' => \$psql_primary{stdout},
+ '2>' => \$psql_primary{stderr},
$psql_timeout);
my %psql_standby = ('stdin' => '', 'stdout' => '', 'stderr' => '');
$psql_standby{run} = IPC::Run::start(
- [ 'psql', '-XA', '-f', '-', '-d', $node_standby->connstr('postgres') ],
- '<',
- \$psql_standby{stdin},
- '>',
- \$psql_standby{stdout},
- '2>',
- \$psql_standby{stderr},
+ [
+ 'psql', '--no-psqlrc', '--no-align',
+ '--file' => '-',
+ '--dbname' => $node_standby->connstr('postgres')
+ ],
+ '<' => \$psql_standby{stdin},
+ '>' => \$psql_standby{stdout},
+ '2>' => \$psql_standby{stderr},
$psql_timeout);
diff --git a/src/test/recovery/t/035_standby_logical_decoding.pl b/src/test/recovery/t/035_standby_logical_decoding.pl
index 8903177d883..c31cab06f1c 100644
--- a/src/test/recovery/t/035_standby_logical_decoding.pl
+++ b/src/test/recovery/t/035_standby_logical_decoding.pl
@@ -75,18 +75,17 @@ sub make_slot_active
my $active_slot = $slot_prefix . 'activeslot';
$slot_user_handle = IPC::Run::start(
[
- 'pg_recvlogical', '-d',
- $node->connstr('testdb'), '-S',
- qq($active_slot), '-o',
- 'include-xids=0', '-o',
- 'skip-empty-xacts=1', '--no-loop',
- '--start', '-f',
- '-'
+ 'pg_recvlogical',
+ '--dbname' => $node->connstr('testdb'),
+ '--slot' => $active_slot,
+ '--option' => 'include-xids=0',
+ '--option' => 'skip-empty-xacts=1',
+ '--file' => '-',
+ '--no-loop',
+ '--start',
],
- '>',
- $to_stdout,
- '2>',
- $to_stderr,
+ '>' => $to_stdout,
+ '2>' => $to_stderr,
IPC::Run::timeout($default_timeout));
if ($wait)
@@ -333,13 +332,14 @@ my %psql_subscriber = (
'subscriber_stdout' => '',
'subscriber_stderr' => '');
$psql_subscriber{run} = IPC::Run::start(
- [ 'psql', '-XA', '-f', '-', '-d', $node_subscriber->connstr('postgres') ],
- '<',
- \$psql_subscriber{subscriber_stdin},
- '>',
- \$psql_subscriber{subscriber_stdout},
- '2>',
- \$psql_subscriber{subscriber_stderr},
+ [
+ 'psql', '--no-psqlrc', '--no-align',
+ '--file' => '-',
+ '--dbname' => $node_subscriber->connstr('postgres')
+ ],
+ '<' => \$psql_subscriber{subscriber_stdin},
+ '>' => \$psql_subscriber{subscriber_stdout},
+ '2>' => \$psql_subscriber{subscriber_stderr},
IPC::Run::timeout($default_timeout));
##################################################
diff --git a/src/test/recovery/t/040_standby_failover_slots_sync.pl b/src/test/recovery/t/040_standby_failover_slots_sync.pl
index 50388a494d6..8f65142909a 100644
--- a/src/test/recovery/t/040_standby_failover_slots_sync.pl
+++ b/src/test/recovery/t/040_standby_failover_slots_sync.pl
@@ -18,7 +18,7 @@ my $publisher = PostgreSQL::Test::Cluster->new('publisher');
# This is only needed on Windows machines that don't use UNIX sockets.
$publisher->init(
allows_streaming => 'logical',
- auth_extra => [ '--create-role', 'repl_role' ]);
+ auth_extra => [ '--create-role' => 'repl_role' ]);
# Disable autovacuum to avoid generating xid during stats update as otherwise
# the new XID could then be replicated to standby at some random point making
# slots at primary lag behind standby during slot sync.
diff --git a/src/test/recovery/t/041_checkpoint_at_promote.pl b/src/test/recovery/t/041_checkpoint_at_promote.pl
index cc5aa80af40..cb63ac8d5c9 100644
--- a/src/test/recovery/t/041_checkpoint_at_promote.pl
+++ b/src/test/recovery/t/041_checkpoint_at_promote.pl
@@ -124,15 +124,14 @@ my $psql_timeout = IPC::Run::timer(3600);
my ($killme_stdin, $killme_stdout, $killme_stderr) = ('', '', '');
my $killme = IPC::Run::start(
[
- 'psql', '-XAtq', '-v', 'ON_ERROR_STOP=1', '-f', '-', '-d',
- $node_standby->connstr('postgres')
+ 'psql', '--no-psqlrc', '--no-align', '--tuples-only', '--quiet',
+ '--set' => 'ON_ERROR_STOP=1',
+ '--file' => '-',
+ '--dbname' => $node_standby->connstr('postgres')
],
- '<',
- \$killme_stdin,
- '>',
- \$killme_stdout,
- '2>',
- \$killme_stderr,
+ '<' => \$killme_stdin,
+ '>' => \$killme_stdout,
+ '2>' => \$killme_stderr,
$psql_timeout);
$killme_stdin .= q[
SELECT pg_backend_pid();