aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2022-05-20 18:29:51 +0900
committerMichael Paquier <michael@paquier.xyz>2022-05-20 18:29:51 +0900
commitb39838889e76274b107935fa8e8951baf0e8b31b (patch)
tree337956ce85d7ef56351a3e4f3c2f1f76593aec1c /src
parenta5084a10fe60412036899a79b3aee76ba31a3579 (diff)
downloadpostgresql-b39838889e76274b107935fa8e8951baf0e8b31b.tar.gz
postgresql-b39838889e76274b107935fa8e8951baf0e8b31b.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/test/perl/PostgreSQL/Test/Cluster.pm14
1 files changed, 14 insertions, 0 deletions
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