model-writtenrun 9528 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Jingzhou Fu reported a PostgreSQL 15.4 subprocess crash involving nested WITH-clause record references in #1; Richard Guo reproduced it and identified incorrect ParseState nesting when expanding an outer-level RECORD Var in #2, then attached the fix in #3.
- Tom Lane confirmed the diagnosis and supplied #4, retaining Richard's approach while improving comments and adding tests that exercise nonzero nesting offsets for both subqueries and CTEs; he could not construct coverage for the RTE_JOIN path.
- Richard Guo endorsed the revised parser fix and identified an analogous deparser problem in #5; Tom Lane suggested testing view or rule dumping in #6, leading Richard to demonstrate a bogus-varno failure and add the ruleutils.c fix and view regression test in #7.
- Andrei Lepikhov introduced a separate CustomScan problem in #8: deparsing composite references through a custom node over a join could fail to find a CTE plan, and his attachment supplied a provisional workaround.
- After Richard Guo could not reproduce the CustomScan failure in #9, Andrei Lepikhov explained the need for a custom extension in #10 and supplied an external reproducer covering both CTE and subquery failures in #11.
- Michael Paquier proposed a reusable CustomScan test module with regression tests in #12, Richard Guo agreed in #13, and Andrei Lepikhov supplied that module and expanded demonstration fixes in #14, explicitly warning that they addressed symptoms rather than causes.
- Tom Lane returned to the RECORD nesting fix in #15, correcting the parent namespace passed to set_deparse_for_query() for both subqueries and CTEs and cleaning up the view test.
- Backpatch testing exposed older anonymous-record failures, prompting Tom Lane's proposal in #15 to backport two existing fixes: the RowExpr field-extraction change originating in thread #41419 was backported as 2f02d4a2b9 and ece1154f4c, while RECORD Const field-name lookup landed in 479b99125d without the original SEARCH/CYCLE-only tests.
- The final attachment in #15 landed unchanged on the development branch as e0e492e5a9, with the listed PostgreSQL 11 counterpart a374f6c616 adapting initialization and regression tests for that branch.
- Richard Guo acknowledged the namespace correction and thanked Tom Lane for committing and backpatching in #16; this reply followed the commits and supplies no pre-commit review credit, while the separate CustomScan proposal from #14 remained unresolved in the supplied thread.