Re: Error on failed COMMIT

Vik Fearing <vik@postgresfriends.org>

From: Vik Fearing <vik@postgresfriends.org>
To: Laurenz Albe <laurenz.albe@cybertec.at>, Dave Cramer <davecramer@postgres.rocks>
Cc: Andrew Dunstan <andrew.dunstan@2ndquadrant.com>, Tony Locke <tlocke@tlocke.org.uk>, Shay Rojansky <roji@roji.org>, Bruce Momjian <bruce@momjian.us>, Robert Haas <robertmhaas@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>, Vladimir Sitnikov <sitnikov.vladimir@gmail.com>, "Haumacher, Bernhard" <haui@haumacher.de>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2021-01-26T17:34:34Z
Lists: pgsql-hackers
On 1/26/21 6:20 PM, Laurenz Albe 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?

The standard is not clear (to me) on what exactly should happen here.
It says that if a <commit statement> is not successful then a <rollback
statement> is implied, but I don't see it say anything about whether the
AND CHAIN should be propagated too.

My vote is that COMMIT AND CHAIN should become ROLLBACK AND NO CHAIN.
-- 
Vik Fearing