public inbox for [email protected]  
help / color / mirror / Atom feed
From: Tom Lane <[email protected]>
To: Sami Imseih <[email protected]>
Cc: Andrew Dunstan <[email protected]>
Cc: Jeff Davis <[email protected]>
Cc: Jeff Davis <[email protected]>
Cc: [email protected]
Subject: Re: pgsql: Trial fix for old cross-version upgrades.
Date: Fri, 28 Feb 2025 14:29:28 -0500
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAA5RZ0vgx8n98dcybr16V5mECEJRruBLMgDoVpmtpG+5D+5VPg@mail.gmail.com>
References: <[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<CAA5RZ0u9dV3CdKqkqdusA_RdvBkwWe0c0rxcFWj++VYoutFYSw@mail.gmail.com>
	<[email protected]>
	<CAA5RZ0udD=7o6pjBSiEEzN60Jd3X1=vrXed+0YivYCVrqvav=Q@mail.gmail.com>
	<CAA5RZ0vgx8n98dcybr16V5mECEJRruBLMgDoVpmtpG+5D+5VPg@mail.gmail.com>

Sami Imseih <[email protected]> writes:
> repro'd. I don't want to attach the file here, but I added a cp
> to get the dump file somewhere local

Thanks for the tips about an efficient repro.  I installed 5.16.3
locally using perlbrew and was able to duplicate the problem.
After a bit of fooling around I found that using an explicit \n
instead of ^ fixes it.  Not the world's most idiomatic regex,
but it'll do.  Will push the attached shortly.

			regards, tom lane



Attachments:

  [text/x-diff] fix-perl-hangup.patch (891B, 2-fix-perl-hangup.patch)
  download | inline diff:
diff --git a/src/test/perl/PostgreSQL/Test/AdjustUpgrade.pm b/src/test/perl/PostgreSQL/Test/AdjustUpgrade.pm
index ec874852d12..81a8f44aa9f 100644
--- a/src/test/perl/PostgreSQL/Test/AdjustUpgrade.pm
+++ b/src/test/perl/PostgreSQL/Test/AdjustUpgrade.pm
@@ -296,7 +296,7 @@ sub adjust_old_dumpfile
 
 	# Same with version argument to pg_restore_relation_stats() or
 	# pg_restore_attribute_stats().
-	$dump =~ s {(^\s+'version',) '\d+'::integer,$}
+	$dump =~ s {\n(\s+'version',) '\d+'::integer,$}
 		{$1 '000000'::integer,}mg;
 
 	if ($old_version < 16)
@@ -645,7 +645,7 @@ sub adjust_new_dumpfile
 
 	# Same with version argument to pg_restore_relation_stats() or
 	# pg_restore_attribute_stats().
-	$dump =~ s {(^\s+'version',) '\d+'::integer,$}
+	$dump =~ s {\n(\s+'version',) '\d+'::integer,$}
 		{$1 '000000'::integer,}mg;
 
 	# pre-v16 dumps do not know about XMLSERIALIZE(NO INDENT).


view thread (30+ messages)  latest in thread

reply

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: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: pgsql: Trial fix for old cross-version upgrades.
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox