model-writtenrun 5526 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Nicolas Lutic reported that restoring a view with an unnamed text column in a CTE failed because the dumped definition referenced a nonexistent "?column?" column, and supplied a reproducer in #1.
- Daniel Gustafsson reproduced the problem on older releases and explained that the added explicit text cast changed FigureColname()'s inferred name on reload in #2; Tom Lane proposed always printing aliases for non-Var expressions in #3, and Daniel supported that approach in #4.
- Tom posted the unconditional alias patch in #5, but its widespread regression-output changes made him question the behavioral churn; detecting actual references to each output name appeared difficult.
- Tom replaced that approach in #6 with a flag tracking whether output names could be visible to surrounding queries, avoiding unnecessary aliases in contexts such as EXISTS subqueries and right-hand set-operation branches while limiting regression changes to materialized-view test output.
- Daniel skimmed the revised patch and endorsed its approach in #7.
- Tom committed #6 as c7461fc255, additionally carrying the visibility flag through RETURNING lists and completing comments; the fix was backpatched to all supported branches, and his final message confirmed it was pushed with no remaining work identified in #8.