Re: fix crash with Python 3.11

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Cc: exclusion@gmail.com, pgsql-hackers@lists.postgresql.org
Date: 2022-02-24T18:17:38Z
Lists: pgsql-hackers

Attachments

I wrote:
> * It might be a good idea to add parallel test cases for the other PLs.

As I suspected, plperl and pltcl show exactly the same problems
when trapping a failure at commit, reinforcing my opinion that this
is a SPI bug that needs to be fixed in SPI.  (plpgsql is not subject
to this problem, because its only mechanism for trapping errors is
a BEGIN block, ie a subtransaction, so it won't get to the interesting
part.)  They do have logic to catch the thrown error, though, so no
additional fix is needed in either once we fix the core code.

v2 attached adds those test cases.

			regards, tom lane

Commits

  1. Re-add SPICleanup for ABI compatibility in stable branch

  2. Fix SPI's handling of errors during transaction commit.

  3. Don't use static storage for SaveTransactionCharacteristics().