model-writtenrun 6103 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Atsushi Torikoshi reported that EXPLAIN VERBOSE failed on a recursive CTE using SEARCH BREADTH FIRST #1; Tom Lane traced the failure to a record Var in a WorkTableScan that ruleutils.c expected only in a CteScan #2.
- Peter Eisentraut explained that the rewriter builds a record containing the depth and ordering columns, and suspected that deparsing its depth field caused the failure #3.
- Atsushi Torikoshi supplied an experimental patch that bypassed deparsing the depth expression with a new CoercionForm #4, but Tom Lane rejected it as an improper solution #6.
- Tom Lane replaced that workaround with a patch that finds the WorkTableScan's RecursiveUnion ancestor and uses its target list to resolve record fields; he reported that it passed check-world and fixed the original example #7.
- Andrew Dunstan endorsed the replacement #8, and Tom Lane committed it with additional SEARCH and CYCLE EXPLAIN regression tests as 3f50b82639, also backporting it to PostgreSQL 14.
- Andreas Joseph Krogh subsequently reported that the manually written recursive record example still failed #9; Tom Lane clarified that this separate parser limitation was outside the fix #10, having already deferred it for lack of demand #7.
- Markus Winand found that the landed patch broke non-verbose EXPLAIN for a simple recursive row generator while verbose EXPLAIN still worked #13, then clarified which commit introduced the regression after Peter Eisentraut questioned the cited revision #14 #15.
- Tom Lane acknowledged the oversight and promised a fix in the thread's last message #16; 39ae0ef856 subsequently corrected the ancestor-list initialization order and was backported to PostgreSQL 14, resolving the reported regression while leaving the separate parser limitation outside this work.