model-writtenrun 2462 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Duncan Sands reported a PostgreSQL 17.4 MERGE failure involving WHEN NOT MATCHED BY SOURCE in #1; Tender Wang reproduced it, isolated the triggering earlier change, and proposed deriving the whole-row type from the view in #2 and #3.
- Tom Lane initially preferred a localized MERGE fix in #4, but Dean Rasheed demonstrated that ordinary UPDATE row marking could produce the same mismatch between whole-row Vars before and after view expansion in #5.
- Tom accepted that makeWholeRowVar() needed a general fix and posted #6, using RTE_SUBQUERY plus a valid relid to recognize expanded views rather than testing relkind.
- Tom supplied the older-branch adaptation in #7, preserving only relid and reporting successful check-world runs with and without forced parallelism; serialization changes were deliberately excluded to preserve compatibility.
- Dean approved the initial approach but demonstrated the same failure for inlined set-returning functions in #8; Tom checked that CTE inlining was unaffected in #10, and Tender approved the initial patch in #11.
- Tom extended the fix in #12 by storing an inlined function's composite-type relation OID in relid, but Dean's testing exposed an unlocked relation_open() assertion and prompted his suggestion to retain rte->functions instead in #13.
- Tom accepted that preserving rte->functions would avoid unsafe relation assumptions and unnecessary catalog lookups in #14, then posted #15 with type handling centralized in makeWholeRowVar(), another regression test, and a separate old-branch prerequisite.
- After Dean reported further testing and approval in #16, the prerequisite landed unchanged as 317aba70ef, and the main fix landed with only comment and brace adjustments as 39af32f788, both from #15; Tom announced the push in #17.
- Andres Freund reported buildfarm failures under WRITE_READ_PARSE_PLAN_TREES on PostgreSQL 13–15 in #18, exposing the consequence of retaining relid without serializing it.
- Tom first proposed clearing relid at the end of planning in #19, then recognized that the post-rewrite serialization check also failed in #20.
- The repair in #21 combined end-of-planning cleanup with removal of the post-rewrite check, because serializing transient rewritten trees served no required storage or parallel-execution purpose; Dean considered copying relids across the check but questioned whether the complexity was worthwhile in #22.
- The repair landed unchanged apart from branch adaptation as b200180dec from #21, and Tom confirmed the push in #23; all posted work had landed, with no revert performed or replacement approach pending.