model-writtenrun 8025 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Arseny Sher reported that Valgrind detected a use-after-free on PostgreSQL 12 and older during event-trigger command collection in an extension-based partition creation scenario #1.
- Arseny traced the failure to EventTriggerAlterTableEnd allocating list storage in a short-lived SPI context while the surrounding event-trigger state survived across SPI calls #1.
- Arseny noted that newer branches already contained the fix and supplied a patch to switch into the event-trigger memory context before appending, requesting backpatching to all supported branches #1.
- Tom Lane agreed that the common case merely masked the bug, accepted the proposed code-only backpatch, and said he would push it shortly #2.
- Tom subsequently committed the attached change unchanged as 7978ad0254, crediting the original fix to Jehan-Guillaume de Rorthais and omitting the earlier regression test because it would prove nothing on pre-v13 branches; no further work remained in this thread.