model-writtenrun 5605 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Joe Wildish reported that a MERGE condition comparing whole rows failed during planning with “variable not found in subplan target lists,” and supplied a reproducer #1.
- Richard Guo identified missing whole-row Vars in the targetlist and submitted a fix collecting source Vars referenced by WHEN conditions in preprocess_targetlist #4.
- Alvaro Herrera expanded that approach to collect only source Vars needed by action conditions and targetlists, removing wasteful parser-time expansion, consolidating row-identity handling, and adding a regression test; he also raised a question about whether Var-collection flags needed restoring #5.
- Richard Guo endorsed the revised approach and suggested list_concat_copy for more efficient list construction #6; his review is not listed separately because he is a credited co-author of the committed fix.
- Alvaro Herrera committed the revised patch with Richard's list-construction suggestion, comment and include cleanup, and adjusted EXPLAIN regression expectations as ce4f46fdc8, retaining the zero Var-collection flags from #5.
- After confirming the commit, Alvaro Herrera reported that EXPLAIN VERBOSE now omitted source columns from Output lines and wondered whether earlier source-targetlist expansion was needed; that follow-up remained unresolved at the end of the thread #7.