Re: fix crash with Python 3.11
Peter Eisentraut <peter.eisentraut@enterprisedb.com>
From: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2022-01-25T14:21:15Z
Lists: pgsql-hackers
On 16.01.22 23:53, Tom Lane wrote: > I think a possible fix is: > > 1. Before entering the PG_TRY block, check for active subtransaction(s) > and immediately throw a Python error if there is one. (This corresponds > to the existing errors "cannot commit while a subtransaction is active" > and "cannot roll back while a subtransaction is active". The point is > to reduce the number of system states we have to worry about below.) > > 2. In the PG_CATCH block, after collecting the error data do > AbortOutOfAnyTransaction(); > StartTransactionCommand(); > which gets us into a good state with no active subtransactions. > > I'm not sure that those two are the best choices of xact.c > entry points, but there's precedent for that in autovacuum.c > among other places. AFAICT, AbortOutOfAnyTransaction() also aborts subtransactions, so why do you suggest the separate handling of subtransactions?
Commits
-
Re-add SPICleanup for ABI compatibility in stable branch
- 6d61aef5dbb6 11.17 landed
- 9af9e2094dcf 12.12 landed
- b2c8d56618b8 13.8 landed
- 8657946d375f 14.5 landed
-
Fix SPI's handling of errors during transaction commit.
- cfc86f987349 13.8 landed
- 2f6b8c287b88 11.17 landed
- 293f5c5f496c 12.12 landed
- 604651880c71 14.5 landed
- 2e517818f4af 15.0 landed
-
Don't use static storage for SaveTransactionCharacteristics().
- 12d768e70497 15.0 landed