model-writtenrun 6046 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Bernd Dorn reported a PostgreSQL 14 segmentation fault involving jsonb_to_recordset and supplied a self-contained reproducer in #1; after Alvaro Herrera requested sample data in #2, Tom Lane confirmed the example was complete and reproduced the crash on HEAD in #3.
- Tom Lane traced the crash to missing default arguments in a jsonb_path_query_array call pulled from a subquery into a function RTE, while the corresponding output expression was processed correctly, in #4.
- Tom Lane's bisect identified 7266d0997d as the regression: moving expression simplification earlier had overlooked expressions inserted by subsequent subquery pullup, as explained in #5.
- Tom Lane attached a fix that repeats eval_const_expressions for every lateral function RTE in #6, choosing this small change because reordering planner preprocessing appeared too complicated; he noted the existing reliance on simplification being idempotent and planned to add a regression test.
- Tom Lane reported that deliberately running expression simplification twice throughout planner.c passed make check-world in #7, decided a permanent buildfarm check was not justified, and announced that he would proceed.
- 4d5f651f1d subsequently landed the fix from #6 with revised comments and regression tests, with backports to PostgreSQL 13 and 14; no further patch revisions remained pending in the supplied thread.