Re: Error on failed COMMIT - Mailing list pgsql-hackers

From Vik Fearing
Subject Re: Error on failed COMMIT
Date
Msg-id 0566886f-ba47-2f6c-4c2f-05a792dfae6f@postgresfriends.org
Whole thread Raw
In response to Re: Error on failed COMMIT  (Laurenz Albe <laurenz.albe@cybertec.at>)
Responses Re: Error on failed COMMIT  (Dave Cramer <davecramer@postgres.rocks>)
List pgsql-hackers
On 25/02/2020 12:11, Laurenz Albe wrote:
> On Tue, 2020-02-25 at 13:25 +0530, Robert Haas wrote:
>> On Tue, Feb 25, 2020 at 12:47 PM Vladimir Sitnikov
>> <sitnikov.vladimir@gmail.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
ratherthan 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.

I started this thread for some discussion and hopefully a documentation
patch.  But now I have moved firmly into the +1 camp.  COMMIT should
error if it can't commit, and then terminate the (aborted) transaction.
-- 
Vik Fearing



pgsql-hackers by date:

Previous
From: "Haumacher, Bernhard"
Date:
Subject: Re: Error on failed COMMIT
Next
From: Alexander Korotkov
Date:
Subject: Re: [Patch] pg_rewind: options to use restore_command fromrecovery.conf or command line