summaryrefslogtreecommitdiff
path: root/src/backend/executor/functions.c
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2025-09-08 11:50:33 -0400
committerRobert Haas <rhaas@postgresql.org>2025-09-08 11:50:33 -0400
commit585e31fcb6dfcb1d88cfee2371f565574db24869 (patch)
treee86ab7395df6b65b6be336a7304f3ef0e7a706ac /src/backend/executor/functions.c
parent3399c265543ec3cdbeff2fa2900e03b326705f63 (diff)
Don't generate fake "*SELECT*" or "*SELECT* %d" subquery aliases.
rte->alias should point only to a user-written alias, but in these cases that principle was violated. Fixing this causes some regression test output changes: wherever rte->alias previously had a value and is now NULL, rte->eref is now set to a generated name rather than to rte->alias; and the scheme used to generate eref names differs from what we were doing for aliases. The upshot is that instead of "*SELECT*" or "*SELECT* %d", EXPLAIN will now emit "unnamed_subquery" or "unnamed_subquery_%d". But that's a reasonable descriptor, and we were already producing that in yet other cases, so this seems not too objectionable. Author: Tom Lane <tgl@sss.pgh.pa.us> Co-authored-by: Robert Haas <rhaas@postgresql.org> Discussion: https://postgr.es/m/CA+TgmoYSYmDA2GvanzPMci084n+mVucv0bJ0HPbs6uhmMN6HMg@mail.gmail.com
Diffstat (limited to 'src/backend/executor/functions.c')
-rw-r--r--src/backend/executor/functions.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/executor/functions.c b/src/backend/executor/functions.c
index 97455b1ed4a..630d708d2a3 100644
--- a/src/backend/executor/functions.c
+++ b/src/backend/executor/functions.c
@@ -2483,7 +2483,7 @@ tlist_coercion_finished:
rte = makeNode(RangeTblEntry);
rte->rtekind = RTE_SUBQUERY;
rte->subquery = parse;
- rte->eref = rte->alias = makeAlias("*SELECT*", colnames);
+ rte->eref = makeAlias("unnamed_subquery", colnames);
rte->lateral = false;
rte->inh = false;
rte->inFromCl = true;