model-writtenrun 1414 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Bihua Wang reported that concurrent MERGE operations in PostgreSQL 18.1 could incorrectly attempt an INSERT in #1; after Laurenz Albe initially considered this expected in #2, the reporter explained that the match condition remained unchanged and that hash joins avoided the failure in #3.
- Dean Rasheed reduced the failure to MERGE from VALUES, confirmed that PostgreSQL 17 worked, and traced the regression to pruning logic incorrectly skipping rowmarks during executor initialization in #4.
- Tender Wang traced the missing rowmarks to VALUES entries being absent from allRelids and proposed adding them in #6; Dean showed that other non-relation RTEs were also affected and supplied an executor-side fix with a MERGE isolation test in #7.
- Tender confirmed additional subquery failures and reported that Dean's fix worked in #8, while Bernice Southey demonstrated lost UPDATEs and supplied an alternative that included every RTE in allRelids in #9.
- Bernice traced the historical introduction of the filtering and reviewed both approaches in #10, then explained the nested-loop and index-scan conditions under which updates disappeared in #13.
- Amit Langote preferred Dean's localized executor checks for backpatching in #11 and #12, explained the original OID-bearing-relation design in #14, and ultimately deferred broader relid-set redesign despite acknowledging its possible benefits in #16; Dean accepted Amit's choice in #15.
- Amit reposted Dean's unchanged implementation and tests with a commit message in #17, and Dean approved that message in #18.
- The reposted patch landed unchanged as f335457e8a, with a PostgreSQL 18 backport, and Amit confirmed the push in #19; the bug fix was complete, with broader design cleanup deferred.