model-writtenrun 8521 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Robins Tharakan reported that SEARCH/CYCLE queries with window-generated resjunk columns in the recursive term produced errors or assertion failures across PostgreSQL branches, supplying reproductions in #1.
- Tom Lane demonstrated the same problem with GROUP BY, traced it to generated columns being appended after resjunk entries, and proposed inserting them before those entries and renumbering the latter in #2.
- Nitin Motiani submitted #3 to detach resjunk entries, append SEARCH/CYCLE columns, and reattach the junk entries with new numbers; he also added regression tests and explained that the non-recursive term was unaffected because its targetlist was left intact.
- Tom Lane committed d27418375d from #3, changing the split to inspect resjunk flags explicitly, asserting the output-column count, expanding comments, and dropping the fourth regression case; the commit records backpatching through PostgreSQL 15.
- In the final reply, #4, Tom Lane confirmed the fix was pushed and explained why he replaced the assumed column count with explicit flag checks, leaving no outstanding patch revisions.