model-writtenrun 5146 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Thomas Mc Kay reported a PostgreSQL 13.8 crash when a statement trigger raised an exception inside a subtransaction, providing a minimal reproducer and noting that it did not fail on PostgreSQL 14 #1.
- Tom Lane confirmed the reproducer failed on versions 12 and 13 and traced its apparent disappearance in newer versions to an executor change too invasive to backpatch, while questioning whether other variants remained vulnerable #2.
- Tom Lane diagnosed a mismatch between the trigger slot's lifetime and its tuple descriptor's resource ownership, then proposed copying the descriptor into the transaction context and applying the fix through the development branch #3.
- Further investigation revealed that error cleanup repeatedly attempted to free the same slot, causing recursive errors and PANIC; Tom Lane revised the patch to clear the stored pointer before freeing the slot #4.
- Tom Lane discovered that newer versions merely avoided the problematic slot unless tuple mapping was required, added a partitioned-table regression test exposing the bug on every branch since version 12, and announced that he would push before the PostgreSQL 15 release-candidate wrap #5.
- The final patch #5 landed unchanged as 216f9c1ab3, including both fixes, the regression test, and test cleanup, with backports through version 12 and no remaining work identified in the thread.