model-writtenrun 3877 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Dean Rasheed reported a pre-existing MERGE bug discovered while working on MERGE RETURNING: cross-partition updates attempted AFTER UPDATE ROW trigger execution and failed with a tuple-fetch error #1.
- His patch made ExecMergeMatched() follow ExecUpdate() by returning immediately after a cross-partition update, preserving update counters and skipping ExecUpdateEpilogue() #1.
- The submission added regression tests comparing trigger execution for ordinary UPDATE and MERGE, and noted that the fix also skips unnecessary post-update WCO/RLS checks whose consequences he had not investigated #1.
- Dean committed the patch with only a test subquery alias added, and the commit specified back-patching to PostgreSQL 15, where MERGE was introduced a4f7d33a90.
- The supplied thread ends with the original submission and contains no review replies or further revisions; its complete fix subsequently landed in a4f7d33a90.