Re: Error on failed COMMIT

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Robert Haas <robertmhaas(at)gmail(dot)com>, Vladimir Sitnikov <sitnikov(dot)vladimir(at)gmail(dot)com>
Cc: Dave Cramer <davecramer(at)postgres(dot)rocks>, Shay Rojansky <roji(at)roji(dot)org>, "Haumacher, Bernhard" <haui(at)haumacher(dot)de>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Error on failed COMMIT
Date: 2020-02-25 11:11:21
Message-ID: 3e68e90f1b764a742511850dd3b700dfd79aec7b.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, 2020-02-25 at 13:25 +0530, Robert Haas wrote:
> On Tue, Feb 25, 2020 at 12:47 PM Vladimir Sitnikov
> <sitnikov(dot)vladimir(at)gmail(dot)com> wrote:
> > Noone suggested that "commit leaves the session in a transaction state".
> > Of course, every commit should terminate the transaction.
> > However, if a commit fails (for any reason), it should produce the relevant ERROR that explains what went wrong rather than silently doing a rollback.
>
> OK, I guess I misinterpreted the proposal. That would be much less
> problematic -- any driver or application that can't handle ERROR in
> response to an attempted COMMIT would be broken already.

I agree with that.

There is always some chance that someone relies on COMMIT not
throwing an error when it rolls back, but I think that throwing an
error is actually less astonishing than *not* throwing one.

So, +1 for the proposal from me.

Yours,
Laurenz Albe

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Antonin Houska 2020-02-25 12:37:40 Re: RS_EPHEMERAL vs RS_TEMPORARY
Previous Message Alexander Korotkov 2020-02-25 10:48:10 Re: [Patch] pg_rewind: options to use restore_command from recovery.conf or command line