Re: BUG #17504: psql --single-transaction -vON_ERROR_STOP=1 still commits after client-side error

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, Christoph Berg <christoph(dot)berg(at)credativ(dot)de>, PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #17504: psql --single-transaction -vON_ERROR_STOP=1 still commits after client-side error
Date: 2022-06-06 20:05:46
Message-ID: CAKFQuwaQvHekKZo6y4ajmRfEjwkPvt_8YDWqVJnfL4py4txFqg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Mon, Jun 6, 2022 at 7:30 AM Robert Haas <robertmhaas(at)gmail(dot)com> wrote:

> On Mon, Jun 6, 2022 at 2:11 AM Kyotaro Horiguchi
> <horikyota(dot)ntt(at)gmail(dot)com> wrote:
> > > >> It causes psql to issue a BEGIN command before the first such option
> > > >> and a COMMIT command after the last one, thereby wrapping all the
> > > >> commands into a single transaction.
> > > >> If any of the commands fails, a ROLLBACK command is sent instead.
> > > >> This ensures that either all the commands complete successfully, or
> > > >> no changes are applied.
> > >
> > > Looks fine to me, so applied down to 10.
> >
> > (Yes!)
>
> I am slightly concerned that this behavior change could break
> somebody's stuff when they upgrade to the next minor release. It does
> not seem impossible that someone could be knowingly relying on the old
> behavior.
>
>
We've done worse when dealing with obvious bugs contrary to the
documentation and that prevent unsafe behavior. People relying on the
defined behavior to safely fail when encountering unexpected failure
producing situations that hopefully never happen get the priority over
poorly written code that somehow relies on errors not respecting the single
transaction promise.

David J.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2022-06-06 21:18:22 Re: BUG #17511: Inconsistent permissions on some information_schema tables
Previous Message David G. Johnston 2022-06-06 19:59:32 Re: BUG #17511: Inconsistent permissions on some information_schema tables