Re: Error on failed COMMIT

Поиск
Список
Период
Сортировка
От Vik Fearing
Тема Re: Error on failed COMMIT
Дата
Msg-id fe797e87-405f-166c-f1ea-3e6ea494d5ed@postgresfriends.org
обсуждение исходный текст
Ответ на Re: Error on failed COMMIT  (Vik Fearing <vik@postgresfriends.org>)
Список pgsql-hackers
On 1/26/21 6:34 PM, Vik Fearing wrote:
> 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.

Hmm.  On the other hand, that means if the client isn't paying
attention, it'll start executing commands outside of a transaction which
will autocommit.  It might be better for a new transaction to be chained
and hopefully also fail because previous bits are missing.

I will hastily change my vote to "unsure".
-- 
Vik Fearing



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Vik Fearing
Дата:
Сообщение: Re: Error on failed COMMIT
Следующее
От: Laurenz Albe
Дата:
Сообщение: Re: Error on failed COMMIT