Content-Length: 267031 | pFad | http://github.com/postgrespro/postgres/commit/8bdd6f563aa2456de602e78991e6a9f61b8ec86d

FF Use a more portable way to get the version string in PostgresNode · postgrespro/postgres@8bdd6f5 · GitHub
Skip to content

Commit 8bdd6f5

Browse files
committed
Use a more portable way to get the version string in PostgresNode
Older versions of perl on Windows don't like the list form of pipe open, and perlcritic doesn't like the string form of open, so we avoid both with a simpler formulation using qx{}. Per complaint from Amit Kapila.
1 parent 413c1ef commit 8bdd6f5

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/test/perl/PostgresNode.pm

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,10 +1248,8 @@ sub _set_pg_version
12481248
local %ENV = $self->_get_env();
12491249

12501250
# We only want the version field
1251-
open my $fh, "-|", $pg_config, "--version"
1252-
or BAIL_OUT("$pg_config failed: $!");
1253-
my $version_line = <$fh>;
1254-
close $fh or die;
1251+
my $version_line = qx{$pg_config --version};
1252+
BAIL_OUT("$pg_config failed: $!") if $?;
12551253

12561254
$self->{_pg_version} = PostgresVersion->new($version_line);
12571255

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/8bdd6f563aa2456de602e78991e6a9f61b8ec86d

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy