model-writtenrun 708 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Jonas Boberg reported that a concurrent UPDATE with a BEFORE UPDATE trigger returned OLD.n = 7 instead of 17 under READ COMMITTED #1; Bharath Rupireddy reproduced the bug and traced it to trigger locking advancing tupleid while leaving oldSlot stale #2.
- Dean Rasheed supplied a fix that checks whether trigger execution traversed the update chain and refetches the old tuple, explaining that DELETE, cross-partition UPDATE, and MERGE already handle the relevant tuple refresh correctly #3.
- Bharath Rupireddy reviewed the patch, suggested reusing the trigger's fetched tuple to avoid extra work, questioned initialization of the traversal flag, and requested broader tests and a more specific error message #4.
- Dean Rasheed retained refetching because its cost seemed negligible and tuple reuse raised concerns about mutation and trigger API changes; his revised patch clarified the comment and error and added tests for the unaffected paths, while deferring broader EPQ restructuring #5.
- Bharath Rupireddy accepted those explanations, tested the revised patch locally, and endorsed backpatching to PostgreSQL 18 #6.
- Dean Rasheed committed the revised patch unchanged as 7048e50f8f and confirmed that it was pushed and backpatched through PostgreSQL 18, completing the bug fix #7.