Add pg_version() to PostgreSQL::Test::Cluster
authorMichael Paquier <[email protected]>
Fri, 20 May 2022 09:29:51 +0000 (18:29 +0900)
committerMichael Paquier <[email protected]>
Fri, 20 May 2022 09:29:51 +0000 (18:29 +0900)
_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/[email protected]

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

index f842be1a72bd5f4a92aaac2abc7e42e33ed321d1..c8c7bc5045a18ad41f9c64f0b6c6529f299711dc 100644 (file)
@@ -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