pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Michael Paquier <michael@paquier.xyz>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: christoph.berg@credativ.de
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17504: psql --single-transaction -vON_ERROR_STOP=1 still commits after client-side error
Date: Fri, 10 Jun 2022 12:12:11 -0400
Message-ID: <2656555.1654877531@sss.pgh.pa.us> (raw)
In-Reply-To: <2649417.1654875709@sss.pgh.pa.us>
References: <YpTgRGknCLBopP8C@msg.df7cb.de>
	<20220531.113927.640026319524742851.horikyota.ntt@gmail.com>
	<YphNHbOkg22H7d52@paquier.xyz>
	<20220603.175603.682874096867945240.horikyota.ntt@gmail.com>
	<Yp1jUAVnyYfn80vu@paquier.xyz>
	<2649417.1654875709@sss.pgh.pa.us>

I wrote:
> ISTM that an appropriate fix would be to remember if any command
> failed, not just the last one.

Alternatively, one could argue that once we've decided to issue
ROLLBACK, there's not really any reason to continue performing
additional -c/-f actions, so that a sufficient fix would be to
get rid of the loop's ON_ERROR_STOP conditionality:

-            if (successResult != EXIT_SUCCESS && pset.on_error_stop)
+            if (successResult != EXIT_SUCCESS)
                 break;

But I'm not sure that that argument is bulletproof.  If we are
considering a client-side failure then the server may still think
the transaction is fine, in which case we should continue to
perform actions that could have client-side side effects; or
at least, not doing so is a potentially significant behavioral
change.

In any case, I now agree with Robert's upthread objection that
this should not have been back-patched.  It's a nontrivial
behavioral change and it's not clear that it's 100% without
downsides.  I particularly do not want to ship 14.4 with this,
because we really need a clean release with no new regressions.

			regards, tom lane





view thread (22+ messages)  latest in thread

Message-ID: <2656555.1654877531@sss.pgh.pa.us>
Permalink:  ../2656555.1654877531@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2656555.1654877531@sss.pgh.pa.us

 · 

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-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, michael@paquier.xyz, robertmhaas@gmail.com, horikyota.ntt@gmail.com, christoph.berg@credativ.de, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #17504: psql --single-transaction -vON_ERROR_STOP=1 still commits after client-side error
  In-Reply-To: <2656555.1654877531@sss.pgh.pa.us>

* 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