Re: Nested Stored Procedures - ERROR: invalid transaction termination 2D000

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Nested Stored Procedures - ERROR: invalid transaction termination 2D000
Дата
Msg-id 442118.1742684108@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Nested Stored Procedures - ERROR: invalid transaction termination 2D000  (Kevin Stephenson <kjs714@hotmail.com>)
Список pgsql-general
Kevin Stephenson <kjs714@hotmail.com> writes:
> Christophe and Tom, thank you for your responses, but I'm still a bit confused. In my original email, the Test 2 case
isallowing a ROLLBACK in the EXCEPTION clause without throwing an error. Is it a NOP ROLLBACK being applied to an
abortedsubTX, a real full ROLLBACK, or something else? Please advise. 

The sub-transaction only exists for the body of the BEGIN construct,
up until EXCEPTION.  By the time control arrives at an exception
handler, we've rolled back the sub-xact and are executing in the outer
transaction again.  So if that's a top-level transaction, you can roll
it back, but if it's a subtransaction you can't.

            regards, tom lane



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