model-writtenrun 5454 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Peter Eisentraut opened the thread with #1, explaining that longjmp out of PL/Python commit and rollback calls corrupts Python 3.11 interpreter state and proposing conversion of PostgreSQL errors into Python exceptions.
- Jacob Champion and Kato, Sho reported successful Linux and Windows testing of the initial patch in #2 and #3, respectively.
- Tom Lane warned in #4 that catching exceptions without repairing transaction state would leave subsequent SPI operations unsafe; discussion in #5 and #6 established that recovery must preserve active subtransactions.
- Peter reported in #7 that indiscriminate transaction cleanup destroyed PL/Python error-handling data, while Tom demonstrated resource leaks and committed foreign-key violations in #8, motivating recovery inside SPI itself.
- Tom supplied the broader implementation in #9: SPI commit and rollback now start replacement transactions, SPI_start_transaction becomes a compatibility no-op, and AtEOXact_SPI handles nested SPI contexts correctly.
- After reproducing the same failures in PL/Perl and PL/Tcl, Tom added regression tests in #10, then supplied SPI documentation and a separate caller-owned transaction-characteristics storage patch in #11 to avoid nested calls overwriting static state.
- The two patches in #11 landed separately on February 28 as 2e517818f4 and 12d768e704, with their attached implementations unchanged apart from rebase offsets.
- After several months of stability, Tom proposed backpatching the transaction-recovery fix in #12, while leaving the transaction-characteristics API change on the development branch because its benefit did not justify compatibility risk.
- Markus Wanner reported in #13 that removing SPICleanup broke extension compatibility and supplied a no-op replacement; after Tom questioned its external use in #14 and #16, Markus identified PGLogical and BDR callers and emphasized stable-branch compatibility in #15 and #17.
- Peter committed Markus's patch unchanged as 8657946d37 and confirmed its application to PostgreSQL 11 through 14 in the final message #18, resolving the compatibility follow-up.