Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1to63C-005zX3-H4 for pgsql-committers@arkaria.postgresql.org; Fri, 28 Feb 2025 19:29:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1to63D-00Dt7K-Ey for pgsql-committers@arkaria.postgresql.org; Fri, 28 Feb 2025 19:29:34 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1to63D-00Dsr9-1f for pgsql-committers@lists.postgresql.org; Fri, 28 Feb 2025 19:29:33 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1to639-000DnL-13; Fri, 28 Feb 2025 19:29:32 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 51SJTSfW2811971; Fri, 28 Feb 2025 14:29:28 -0500 From: Tom Lane To: Sami Imseih cc: Andrew Dunstan , Jeff Davis , Jeff Davis , pgsql-committers@lists.postgresql.org Subject: Re: pgsql: Trial fix for old cross-version upgrades. In-reply-to: References: <003dc9936317ab987faa0242f8e33e1cd2fcaf57.camel@j-davis.com> <40c1e76334f2baa747334c8fc513d12b8cb297bf.camel@j-davis.com> <3815127.1740189601@sss.pgh.pa.us> <5ebc188e731ac2b98d68459ce1a9ef3066981774.camel@j-davis.com> <3892121.1740193866@sss.pgh.pa.us> <976dcc37-b629-490e-a052-a057477d062f@dunslane.net> <301492.1740249291@sss.pgh.pa.us> <684274.1740273302@sss.pgh.pa.us> <812817.1740277228@sss.pgh.pa.us> <10bd5e38-c8e1-4162-8dd7-ef65e71170b4@dunslane.net> <1144186.1740338230@sss.pgh.pa.us> <2768649.1740765297@sss.pgh.pa.us> Comments: In-reply-to Sami Imseih message dated "Fri, 28 Feb 2025 12:39:59 -0600" MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0" Content-ID: <2802857.1740770946.0@sss.pgh.pa.us> Date: Fri, 28 Feb 2025 14:29:28 -0500 Message-ID: <2811968.1740770968@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk ------- =_aaaaaaaaaa0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2802857.1740770946.1@sss.pgh.pa.us> Sami Imseih 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 ------- =_aaaaaaaaaa0 Content-Type: text/x-diff; name="fix-perl-hangup.patch"; charset="us-ascii" Content-ID: <2802857.1740770946.2@sss.pgh.pa.us> Content-Description: fix-perl-hangup.patch Content-Transfer-Encoding: quoted-printable diff --git a/src/test/perl/PostgreSQL/Test/AdjustUpgrade.pm b/src/test/per= l/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 =3D~ s {(^\s+'version',) '\d+'::integer,$} + $dump =3D~ 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 =3D~ s {(^\s+'version',) '\d+'::integer,$} + $dump =3D~ s {\n(\s+'version',) '\d+'::integer,$} {$1 '000000'::integer,}mg; = # pre-v16 dumps do not know about XMLSERIALIZE(NO INDENT). ------- =_aaaaaaaaaa0--