Re: pgsql: Trial fix for old cross-version upgrades.

From: Sami Imseih <samimseih(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, Jeff Davis <pgsql(at)j-davis(dot)com>, Jeff Davis <jdavis(at)postgresql(dot)org>, pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: Trial fix for old cross-version upgrades.
Date: 2025-02-28 18:39:59
Message-ID: CAA5RZ0vgx8n98dcybr16V5mECEJRruBLMgDoVpmtpG+5D+5VPg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

> I also tested the same regexp expression in isolation
> and I could not repro the issue. Will try a real dumpfile next.
>

repro'd. I don't want to attach the file here, but I added a cp
to get the dump file somewhere local

+++ b/src/bin/pg_upgrade/t/002_pg_upgrade.pl
@@ -326,10 +326,12 @@ $oldnode->restart;
my @dump_command = (
'pg_dumpall', '--no-sync', '-d', $oldnode->connstr('postgres'),
'-f', $dump1_file);
+
# --extra-float-digits is needed when upgrading from a version older than 11.
push(@dump_command, '--extra-float-digits', '0')
if ($oldnode->pg_version < 12);
$newnode->command_ok(\(at)dump_command, 'dump before running pg_upgrade');
+system("cp $dump1_file /tmp/myfile.dmp");

and ran with the following perl script

"""
use strict;
use File::Slurp;

my $dump = read_file( '/tmp/myfile.dmp' );
#my $dump = "filler\n 'version', '180000'::integer,\n filler";
print "$dump\n";
$dump =~ s [(^\s+'version',) '\d+'::integer,$] [$1 '000000'::integer,]mg;

print "$dump\n";
"""

--
Sami

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Sami Imseih 2025-02-28 19:29:16 Re: pgsql: Trial fix for old cross-version upgrades.
Previous Message Masahiko Sawada 2025-02-28 18:31:12 pgsql: Refactor COPY FROM to use format callback functions.