Re: Error on failed COMMIT

From: Vik Fearing <vik(at)postgresfriends(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Dave Cramer <davecramer(at)gmail(dot)com>
Subject: Re: Error on failed COMMIT
Date: 2020-02-24 22:37:45
Message-ID: f99145dd-ec52-f2dd-cd25-39300d9bc09f@postgresfriends.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 12/02/2020 00:27, Tom Lane wrote:
> Vik Fearing <vik(at)postgresfriends(dot)org> writes:
>> On 11/02/2020 23:35, Tom Lane wrote:
>>> So I assume you're imagining that that would leave us still in
>>> transaction-aborted state, and the session is basically dead in
>>> the water until the user thinks to issue ROLLBACK instead?
>
>> Actually, I was imagining that it would end the transaction as it does
>> today, just with an error code.
>> This is backed up by General Rule 9 which says "The current
>> SQL-transaction is terminated."
>
> Hm ... that would be sensible, but I'm not entirely convinced. There
> are several preceding rules that say that an exception condition is
> raised, and normally you can stop reading at that point; nothing else
> is going to happen. If COMMIT acts specially in this respect, they
> ought to say so.

Reading some more, I believe they do say so.

SQL:2016-2 Section 4.41 SQL-transactions:

If an SQL-transaction is terminated by a <rollback statement> or
unsuccessful execution of a <commit statement>, then all changes
made to SQL-data or schemas by that SQL-transaction are canceled.

This to me says that an unsuccessful COMMIT still terminates the
transaction.
--
Vik Fearing

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Korotkov 2020-02-24 22:54:10 Re: Improve search for missing parent downlinks in amcheck
Previous Message Vladimir Sitnikov 2020-02-24 22:06:23 Re: Error on failed COMMIT