pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert Haas <rhaas@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Don't generate fake "*SELECT*" or "*SELECT* %d" subquery aliases
Date: Mon, 08 Sep 2025 15:57:15 +0000
Message-ID: <E1uveF1-0018aG-16@gemulon.postgresql.org> (raw)

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/585e31fcb6dfcb1d88cfee2371f565574db24869

Modified Files
--------------
contrib/postgres_fdw/expected/postgres_fdw.out |  8 ++++----
src/backend/executor/functions.c               |  2 +-
src/backend/parser/analyze.c                   |  7 ++-----
src/test/regress/expected/partition_prune.out  |  4 ++--
src/test/regress/expected/rangefuncs.out       |  8 ++++----
src/test/regress/expected/union.out            | 14 +++++++-------
6 files changed, 20 insertions(+), 23 deletions(-)



Message-ID: <E1uveF1-0018aG-16@gemulon.postgresql.org>
Permalink:  ../E1uveF1-0018aG-16@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1uveF1-0018aG-16@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: rhaas@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Don't generate fake "*SELECT*" or "*SELECT* %d" subquery aliases
  In-Reply-To: <E1uveF1-0018aG-16@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox