Re: Error on failed COMMIT

From: Dave Cramer <davecramer(at)postgres(dot)rocks>
To: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
Cc: Andrew Dunstan <andrew(dot)dunstan(at)2ndquadrant(dot)com>, Tony Locke <tlocke(at)tlocke(dot)org(dot)uk>, Shay Rojansky <roji(at)roji(dot)org>, Bruce Momjian <bruce(at)momjian(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, Vik Fearing <vik(at)postgresfriends(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Vladimir Sitnikov <sitnikov(dot)vladimir(at)gmail(dot)com>, "Haumacher, Bernhard" <haui(at)haumacher(dot)de>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Error on failed COMMIT
Date: 2021-01-26 18:02:06
Message-ID: CADK3HHLddDxgNZz+HJHJ3n6ZAYLjpsP5W6KF2msH-iZAXouXQg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, 26 Jan 2021 at 12:46, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at> wrote:

> On Tue, 2021-01-26 at 12:25 -0500, Dave Cramer wrote:
> > > After thinking some more about it, I think that COMMIT AND CHAIN would
> have
> > > to change behavior: if COMMIT throws an error (because the transaction
> was
> > > aborted), no new transaction should be started. Everything else seems
> fishy:
> > > the statement fails, but still starts a new transaction?
> > >
> > > I guess that's also at fault for the unexpected result status that
> > > Masahiko complained about in the other message.
> >
> >
> > I haven't had a look at the result status in libpq. For JDBC we don't
> see that.
> > We throw an exception when we get this error report. This is very
> consistent as the commit fails and we throw an exception
> >
> > > So I think we should not introduce USER_ERROR at all. It is too much
> > > of a kluge: fail, but not really...
> >
> > What we do now is actually worse as we do not get an error report and we
> silently change commit to rollback.
> > How is this better ?
>
> I see your point from the view of the JDBC driver.
>
> It just feels hacky - somewhat similar to what you say
> above: don't go through the normal transaction rollback steps,
> but issue an error message.
>
> At least we should fake it well...
>

OK, let me look into how we deal with COMMIT and CHAIN.

I can see some real issues with this as Vik pointed out.

Dave

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2021-01-26 18:40:31 Re: Deleting older versions in unique indexes to avoid page splits
Previous Message Bruce Momjian 2021-01-26 17:58:27 Re: mkid reference