model-writtenrun 9204 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Piotr Gabriel Kosinski reported a reproducible PostgreSQL 11 crash when successive BEFORE UPDATE triggers return OLD and modify NEW, providing SQL and a backtrace in #1.
- Thomas Munro diagnosed a double-free in ExecBRUpdateTriggers and posted an inline oldtuple != trigtuple guard that passed regression tests, noting that slotification already prevented the failure on the development branch #2.
- Tom Lane explained that PostgreSQL 11's PL/pgSQL could expose an older tuple-aliasing bug by returning OLD without copying it, and proposed regression coverage on every branch #3; Andres Freund identified related historical fixes #4.
- Tom Lane supplied a test using existing regression trigger code that crashed PostgreSQL 9.4 through 11 #5; Thomas Munro then posted his independently written fix and PL/pgSQL test for posterity, yielding to Lane's test because it exposed the bug on more releases #6.
- Tom Lane confirmed that the previous repair had left this case uncovered #7, then committed his test unchanged as 1ced082b95, with Munro's code fix included in the stable-branch backports and Munro's alternative test left out.
- Tom Lane announced that the fix had been pushed in #8, closing the thread with the regression coverage and required stable-branch repairs landed.