]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Don't generate fake "*TLOCRN*" or "*TROCRN*" aliases, either.
authorRobert Haas <rhaas@postgresql.org>
Mon, 8 Sep 2025 16:58:07 +0000 (12:58 -0400)
committerRobert Haas <rhaas@postgresql.org>
Mon, 8 Sep 2025 16:58:07 +0000 (12:58 -0400)
This is just like the previous two commits, except that this fix
actually doesn't change any regression test outputs.

Author: Robert Haas <rhaas@postgresql.org>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/CA+TgmoYSYmDA2GvanzPMci084n+mVucv0bJ0HPbs6uhmMN6HMg@mail.gmail.com

src/backend/rewrite/rewriteSearchCycle.c

index 9f95d4dc1b0e84de5e9194ab10f49d8865b49216..5202ef43d1068a4df908441fc009adce9de40f1e 100644 (file)
@@ -282,8 +282,8 @@ rewriteSearchAndCycle(CommonTableExpr *cte)
 
        newrte = makeNode(RangeTblEntry);
        newrte->rtekind = RTE_SUBQUERY;
-       newrte->alias = makeAlias("*TLOCRN*", cte->ctecolnames);
-       newrte->eref = newrte->alias;
+       newrte->alias = NULL;
+       newrte->eref = makeAlias("*TLOCRN*", cte->ctecolnames);
        newsubquery = copyObject(rte1->subquery);
        IncrementVarSublevelsUp((Node *) newsubquery, 1, 1);
        newrte->subquery = newsubquery;
@@ -379,8 +379,8 @@ rewriteSearchAndCycle(CommonTableExpr *cte)
                ewcl = lappend(ewcl, makeString(cte->cycle_clause->cycle_mark_column));
                ewcl = lappend(ewcl, makeString(cte->cycle_clause->cycle_path_column));
        }
-       newrte->alias = makeAlias("*TROCRN*", ewcl);
-       newrte->eref = newrte->alias;
+       newrte->alias = NULL;
+       newrte->eref = makeAlias("*TROCRN*", ewcl);
 
        /*
         * Find the reference to the recursive CTE in the right UNION subquery's