From: Michael Paquier Date: Fri, 20 May 2022 09:29:51 +0000 (+0900) Subject: Add pg_version() to PostgreSQL::Test::Cluster X-Git-Tag: REL_15_BETA2~117 X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=b39838889e76274b107935fa8e8951baf0e8b31b;p=postgresql.git Add pg_version() to PostgreSQL::Test::Cluster _pg_version (version number based on PostgreSQL::Version) is a field private to Cluster.pm but there was no helper routine to retrieve it from a Cluster's node. The same is done for install_path, for example, and the version object becomes handy when writing tests that need version-specific handling. Reviewed-by: Andrew Dunstan, Daniel Gustafsson Discussion: https://postgr.es/m/YoWfoJTc987tsxpV@paquier.xyz --- diff --git a/src/test/perl/PostgreSQL/Test/Cluster.pm b/src/test/perl/PostgreSQL/Test/Cluster.pm index f842be1a72b..c8c7bc5045a 100644 --- a/src/test/perl/PostgreSQL/Test/Cluster.pm +++ b/src/test/perl/PostgreSQL/Test/Cluster.pm @@ -331,6 +331,20 @@ sub install_path =pod +=item $node->pg_version() + +The version number for the node, from PostgreSQL::Version. + +=cut + +sub pg_version +{ + my ($self) = @_; + return $self->{_pg_version}; +} + +=pod + =item $node->config_data($option) Return a string holding configuration data from pg_config, with $option