From 6922ab1621f4429b059e82845ea9d6143f3eb9cd Mon Sep 17 00:00:00 2001
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
Date: Wed, 19 Jul 2023 17:54:09 +0200
Subject: [PATCH] Use numeric comparison instead of PostgreSQL::Version

This seems like the wrong approach to deal with the problem.

Discussion: https://postgr.es/m/20230719110504.zbu74o54bqqlsufb@alvherre.pgsql
---
 src/bin/pg_upgrade/t/002_pg_upgrade.pl         | 2 +-
 src/test/perl/PostgreSQL/Test/AdjustUpgrade.pm | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/bin/pg_upgrade/t/002_pg_upgrade.pl b/src/bin/pg_upgrade/t/002_pg_upgrade.pl
index a5688a1cf2..75c9ee9b73 100644
--- a/src/bin/pg_upgrade/t/002_pg_upgrade.pl
+++ b/src/bin/pg_upgrade/t/002_pg_upgrade.pl
@@ -242,7 +242,7 @@ if (defined($ENV{oldinstall}))
 	do { $dbnames{$_} = 1; }
 	  foreach split /\s+/s, $dbnames;
 	my $adjust_cmds =
-	  adjust_database_contents($oldnode->pg_version, %dbnames);
+	  adjust_database_contents($oldnode->pg_version->major, %dbnames);
 
 	foreach my $updb (keys %$adjust_cmds)
 	{
diff --git a/src/test/perl/PostgreSQL/Test/AdjustUpgrade.pm b/src/test/perl/PostgreSQL/Test/AdjustUpgrade.pm
index a241d2ceff..301acbd01c 100644
--- a/src/test/perl/PostgreSQL/Test/AdjustUpgrade.pm
+++ b/src/test/perl/PostgreSQL/Test/AdjustUpgrade.pm
@@ -200,7 +200,7 @@ sub adjust_database_contents
 			'drop function oldstyle_length(integer, text)');
 	}
 
-	if ($old_version lt '9.5')
+	if ($old_version < '9.5')
 	{
 		# cope with changes of underlying functions
 		_add_st(
-- 
2.39.2

