model-writtenrun 5340 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Egor Chindyaskin reported that a ROW expression with an extremely long argument list crashed through an overflowing attribute number in #1; Francisco Olarte noted that the reproducer and backtrace differed by a row_to_json wrapper, which he thought immaterial, in #2.
- Alvaro Herrera supplied an executor-side overflow guard in #3, and Richard Guo questioned its boundary condition in #4.
- Tom Lane argued that parsing should reject oversized rows using MaxTupleAttributeNumber in #5, then replaced the executor guard with a transformRowExpr() check and proposed consistent SQLSTATE reporting in #6.
- Richard Guo explained the tuple-size limit in #7 and approved the replacement while asking about other expression types in #8; Tom initially considered subqueries and ROW constructors sufficient, while acknowledging uncertainty about other tuple-producing paths, in #9.
- Tom committed #6 as fd96d14d95, preserving its parser check and adding the proposed SELECT-list SQLSTATE adjustment, with backports to all supported branches.
- Egor confirmed that the original case was fixed but supplied another crash involving json_to_record and an oversized column-definition list in #10, reopening the investigation for function range-table entries.
- Richard proposed checking function column-definition lists in #11, supplied an inline implementation in #12, and identified MaxHeapAttributeNumber as the appropriate limit in #13; Tom accepted that limit and identified the additional need to check merged function results in #14.
- The thread ended with Tom promising the follow-up fix in #14; he subsequently committed 83f1793d60, adding checks in parse_relation.c for column-definition lists, merged function results, and table-function results, with backports and no attached patch left pending.