pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Qualify unqualified names in CREATE SCHEMA elements again.
Date: Thu, 22 Oct 2026 17:19:52 +0000
Message-ID: <E1xJwSG-00000000LYf-1jnL@gemulon.postgresql.org> (raw)

Qualify unqualified names in CREATE SCHEMA elements again.

Commit a9c350d9e stopped filling in the new schema's name, and the
partial revert in 962e0a723 kept that, which was an error: it allows
names that will be looked up rather than created to be resolved in
pg_temp or pg_catalog, which they should not be.  This for example
allowed a CREATE INDEX to target a chance-match table name in pg_temp
rather than the expected table in the new schema.  Revert to the old
approach of putting the new schema's name into each RangeVar.  We can
still keep the refactorization of dealing with RangeVars as such
instead of working with char* pointers.

Author: shihao zhong <zhong950419@gmail.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/CAGRkXqRMkfs25+7ReRkF4WCogEnD1k1=L=fmA_kxbtDfmhFn-g@mail.gmail.com
Backpatch-through: 19

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/df34fdf3f59498d94c4008aa8f7977873e47dc76

Modified Files
--------------
src/backend/parser/parse_utilcmd.c | 38 ++++++++++++++++++++------------------
1 file changed, 20 insertions(+), 18 deletions(-)



view thread (2+ messages)

Message-ID: <E1xJwSG-00000000LYf-1jnL@gemulon.postgresql.org>
Permalink:  ../E1xJwSG-00000000LYf-1jnL@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1xJwSG-00000000LYf-1jnL@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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Qualify unqualified names in CREATE SCHEMA elements again.
  In-Reply-To: <E1xJwSG-00000000LYf-1jnL@gemulon.postgresql.org>
  References: <E1xJwSG-00000000LYf-1jnL@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