Content-Length: 298896 | pFad | http://github.com/postgrespro/postgres/commit/ba15f16107bea8a93edc505f3013cd7df4ac90fc

75 Add PostgreSQL::Test::Cluster::config_data() · postgrespro/postgres@ba15f16 · GitHub
Skip to content

Commit ba15f16

Browse files
committed
Add PostgreSQL::Test::Cluster::config_data()
This is useful to grab some configuration information from a node already set up, and I personally found two cases for it: pg_upgrade and a test to emulate check_guc. Author: Michael Paquier Discussion: https://postgr.es/m/20211129030833.GJ17618@telsasoft.com Discussion: https://postgr.es/m/YJ8xTmLQkotVLpN5@paquier.xyz
1 parent f1ea98a commit ba15f16

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

src/test/perl/PostgreSQL/Test/Cluster.pm

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,31 @@ sub install_path
327327

328328
=pod
329329
330+
=item $node->config_data($option)
331+
332+
Return a string holding configuration data from pg_config, with $option
333+
being the option switch used with the pg_config command.
334+
335+
=cut
336+
337+
sub config_data
338+
{
339+
my ($self, $option) = @_;
340+
local %ENV = $self->_get_env();
341+
342+
my ($stdout, $stderr);
343+
my $result =
344+
IPC::Run::run [ $self->installed_command('pg_config'), $option ],
345+
'>', \$stdout, '2>', \$stderr
346+
or die "could not execute pg_config";
347+
chomp($stdout);
348+
$stdout =~ s/\r$//;
349+
350+
return $stdout;
351+
}
352+
353+
=pod
354+
330355
=item $node->info()
331356
332357
Return a string containing human-readable diagnostic information (paths, etc)

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/ba15f16107bea8a93edc505f3013cd7df4ac90fc

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy