- Notifications
You must be signed in to change notification settings - Fork28
Commitbe7485a
committed
Fix psql's ON_ERROR_ROLLBACK so that it handles COMMIT AND CHAIN.
When ON_ERROR_ROLLBACK is enabled, psql releases a temporary savepointif it's idle in a valid transaction block after executing a query. But psqldoesn't do that after RELEASE or ROLLBACK is executed because a temporarysavepoint has already been destroyed in that case.This commit changes psql's ON_ERROR_ROLLBACK so that it doesn't releasea temporary savepoint also when COMMIT AND CHAIN is executed. A temporarysavepoint doesn't need to be released in that case becauseCOMMIT AND CHAIN also destroys any savepoints defined within the transactionto commit. Otherwise psql tries to release the savepoint thatCOMMIT AND CHAIN has already destroyed and cause an error"ERROR: savepoint "pg_psql_temporary_savepoint" does not exist".Back-patch to v12 where transaction chaining was added.Reported-by: Arthur NascimentoAuthor: Arthur NascimentoReviewed-by: Fujii Masao, Vik FearingDiscussion:https://postgr.es/m/16867-3475744069228158@postgresql.org1 parent422012c commitbe7485a
1 file changed
+5
-4
lines changedLines changed: 5 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1346 | 1346 |
| |
1347 | 1347 |
| |
1348 | 1348 |
| |
1349 |
| - | |
1350 |
| - | |
1351 |
| - | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
1352 | 1352 |
| |
1353 | 1353 |
| |
1354 |
| - | |
| 1354 | + | |
| 1355 | + | |
1355 | 1356 |
| |
1356 | 1357 |
| |
1357 | 1358 |
| |
|
0 commit comments
Comments
(0)