From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Kevin Stephenson <kjs714(at)hotmail(dot)com> |
Cc: | Christophe Pettus <xof(at)thebuild(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Nested Stored Procedures - ERROR: invalid transaction termination 2D000 |
Date: | 2025-03-22 22:55:08 |
Message-ID: | 442118.1742684108@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Kevin Stephenson <kjs714(at)hotmail(dot)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 is allowing a ROLLBACK in the EXCEPTION clause without throwing an error. Is it a NOP ROLLBACK being applied to an aborted subTX, 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
From | Date | Subject | |
---|---|---|---|
Next Message | Igor Korot | 2025-03-23 00:31:45 | Determine server version from psql script |
Previous Message | Christophe Pettus | 2025-03-22 22:18:07 | Re: Nested Stored Procedures - ERROR: invalid transaction termination 2D000 |