pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jeff Davis <pgsql@j-davis.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Further further fix pg_upgrade crossversion test for adminpack.
Date: Fri, 08 Mar 2024 23:48:08 -0800
Message-ID: <bca97aecb50b2026b7dbc26604bf31861c819a64.camel@j-davis.com> (raw)
In-Reply-To: <E1rhClo-0024Gh-8k@gemulon.postgresql.org>
References: <E1rhClo-0024Gh-8k@gemulon.postgresql.org>

On Mon, 2024-03-04 at 18:10 +0000, Tom Lane wrote:
> Further further fix pg_upgrade crossversion test for adminpack.

Ever since this commit the cross-version upgrade test is failing (for
me, at least) with:

# Running: psql -X -v ON_ERROR_STOP=1 -c drop database if exists
contrib_regression_adminpack;
drop database if exists regression_adminpack -d port=53977
host=/tmp/EK6UT_TufI dbname='postgres'
ERROR:  DROP DATABASE cannot run inside a transaction block

It looks like when you added another command, the two were joined with
";\n", which ends up running the commands in a transaction block, which
doesn't work for DROP DATABASE.

I'm not sure how this test is succeeding for others, so perhaps I'm
doing something wrong?

Patch attached, though I'm not particularly great with perl and the
array flattening in my implementation might be too magical.

Regards,
	Jeff Davis

Attachments:

0001-Fix-cross-version-pg_upgrade-test.patch (text/x-patch, 1.1K) download From 54e13ddb01b859606ebe938a98587aef666df668 Mon Sep 17 00:00:00 2001 From: Jeff Davis <jeff@j-davis.com> Date: Fri, 8 Mar 2024 23:37:16 -0800 Subject: [PATCH] Fix cross-version pg_upgrade test. --- src/bin/pg_upgrade/t/002_pg_upgrade.pl | 8 ++++++-- 1 file changed, 6 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 d951ed3af0..16b42d475f 100644 --- a/src/bin/pg_upgrade/t/002_pg_upgrade.pl +++ b/src/bin/pg_upgrade/t/002_pg_upgrade.pl @@ -246,15 +246,19 @@ if (defined($ENV{oldinstall})) foreach my $updb (keys %$adjust_cmds) { - my $upcmds = join(";\n", @{ $adjust_cmds->{$updb} }); + my @command_args = (); + for my $upcmd (@{ $adjust_cmds->{$updb} }) + { + push @command_args, '-c', $upcmd; + } # For simplicity, use the newer version's psql to issue the commands. $newnode->command_ok( [ 'psql', '-X', '-v', 'ON_ERROR_STOP=1', - '-c', $upcmds, '-d', $oldnode->connstr($updb), + @command_args, ], "ran version adaptation commands for database $updb"); } -- 2.34.1

view thread (4+ messages)  latest in thread

Message-ID: <bca97aecb50b2026b7dbc26604bf31861c819a64.camel@j-davis.com>
Permalink:  ../bca97aecb50b2026b7dbc26604bf31861c819a64.camel@j-davis.com/
Also on:    postgresql.org/message-id/bca97aecb50b2026b7dbc26604bf31861c819a64.camel@j-davis.com

 ·  · 

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: pgsql-committers@postgresql.org
  Cc: pgsql@j-davis.com, tgl@sss.pgh.pa.us, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Further further fix pg_upgrade crossversion test for adminpack.
  In-Reply-To: <bca97aecb50b2026b7dbc26604bf31861c819a64.camel@j-davis.com>

* 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