From: Potapov Alexander <a.potapov@postgrespro.com>
To: pgsql-hackers@lists.postgresql.org
Subject: PG version is not seen in pg_upgrade test log
Date: Sun, 30 Nov 2025 12:11:44 +0300
Message-ID: <e59bb-692c0a80-5-6f987180@170377126> (raw)
Hello!
I ran pg_upgrade tests (make check -C src/bin/pg_upgrade) and found that test log does not contain PG version:
(file: src/bin/pg_upgrade/tmp_check/log/regress_log_002_pg_upgrade)
Name: old_node
Data directory: /home/dev/code/postgrespro3/src/bin/pg_upgrade/tmp_check/t_002_pg_upgrade_old_node_data/pgdata
Backup directory: /home/dev/code/postgrespro3/src/bin/pg_upgrade/tmp_check/t_002_pg_upgrade_old_node_data/backup
This happens because $node->_set_pg_version is called after invocation of $node->dump_info. To fix it we should change line order in Cluster.pm file. The result looks like:
Name: old_node
Version: 19devel
Data directory: /home/dev/code/postgrespro3/src/bin/pg_upgrade/tmp_check/t_002_pg_upgrade_old_node_data/pgdata
Backup directory: /home/dev/code/postgrespro3/src/bin/pg_upgrade/tmp_check/t_002_pg_upgrade_old_node_data/backup
The change I suggest is:
--- a/src/test/perl/PostgreSQL/Test/Cluster.pm
+++ b/src/test/perl/PostgreSQL/Test/Cluster.pm
@@ -1647,10 +1647,10 @@ sub new
or
BAIL_OUT("could not create data directory \"$node->{_basedir}\": $!");
- $node->dump_info;
-
$node->_set_pg_version;
+ $node->dump_info;
+
my $ver = $node->{_pg_version};
Patch attached.
Best regards,
Alexander Potapov
Attachments:0001-Show-PG-version-in-pg_upgrade-test-log.patch (application/octet-stream, 854B) download
From 156e9a933730d0b6a35273e14b094a96a1ea338e Mon Sep 17 00:00:00 2001
From: Potapov Alexander <a.potapov@postgrespro.ru>
Date: Thu, 23 Oct 2025 10:09:24 +0300
Subject: [PATCH] Show PG version in pg_upgrade test log
---
src/test/perl/PostgreSQL/Test/Cluster.pm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/test/perl/PostgreSQL/Test/Cluster.pm b/src/test/perl/PostgreSQL/Test/Cluster.pmindex 35413f14019..747528c4af1 100644--- a/src/test/perl/PostgreSQL/Test/Cluster.pm+++ b/src/test/perl/PostgreSQL/Test/Cluster.pm@@ -1647,10 +1647,10 @@ sub new
or
BAIL_OUT("could not create data directory \"$node->{_basedir}\": $!");
- $node->dump_info;-
$node->_set_pg_version;
+ $node->dump_info;+
my $ver = $node->{_pg_version};
# Use a subclass as defined below (or elsewhere) if this version
--
2.40.1
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: a.potapov@postgrespro.com, pgsql-hackers@lists.postgresql.org
Subject: Re: PG version is not seen in pg_upgrade test log
In-Reply-To: <e59bb-692c0a80-5-6f987180@170377126>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox