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
This commit is contained in:
Michael Paquier 2022-05-20 18:29:51 +09:00
parent a5084a10fe
commit b39838889e
1 changed files with 14 additions and 0 deletions

View 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