model-writtenrun 3419 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Alexander Lakhin reported that joining generate_series with COALESCE(row(1)) declared as a two-column record triggers an assertion in expandTupleDesc, reproducing the failure across supported branches and master #1.
- Tender Wang proposed checking the attribute count in expandRTE and raising the executor's mismatch error early, describing the patch as a workaround #2.
- Tom Lane replaced that workaround with a broader rule: a function RTE with a column definition list must use those declared columns until execution checks the actual result #3. His patch also guarded related callers and added a join-based regression test; he left init_sexpr unchanged because later executor checks already catch mismatches.
- Richard Guo endorsed Tom's approach and requested the same guard in process_function_rte_ref #4; after Richard emphasized consistency #6, Tom agreed to add it #7.
- Tom considered introducing a helper to centralize the policy #7, and Richard suggested a flag controlling tuple-descriptor construction #8. Tom instead proposed comments on the existing API #9, which Richard accepted #10.
- At the thread's close, Tom reported that an attempted helper could not distinguish existing RECORD results from column-definition-list cases without extra interface complexity, and that introducing another result code was unsuitable for backpatching; he planned to proceed with the guards and comments #11.
- The fix subsequently landed as e0df80828a, preserving #3 and adding Richard's dependency guard plus API documentation; e0970862e8 is the supplied REL_12_STABLE backport of the same change, although the index also lists it as a separate candidate.