diff --git a/src/test/perl/PostgresNode.pm b/src/test/perl/PostgresNode.pm index 46530255e0..45d1636128 100644 --- a/src/test/perl/PostgresNode.pm +++ b/src/test/perl/PostgresNode.pm @@ -2127,7 +2127,7 @@ sub poll_query_until my $cmd = [ $self->installed_command('psql'), - '-XAt', '-c', $query, '-d', $self->connstr($dbname) + '-XAt', '-d', $self->connstr($dbname) ]; my ($stdout, $stderr); my $max_attempts = 180 * 10; @@ -2135,7 +2135,8 @@ sub poll_query_until while ($attempts < $max_attempts) { - my $result = IPC::Run::run $cmd, '>', \$stdout, '2>', \$stderr; + my $result = IPC::Run::run $cmd, '<', \$query, + '>', \$stdout, '2>', \$stderr; $stdout =~ s/\r\n/\n/g if $Config{osname} eq 'msys'; chomp($stdout);