pgsql: Qualify unqualified names in CREATE SCHEMA elements again.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Qualify unqualified names in CREATE SCHEMA elements again.
Date: 2026-10-22 17:19:52
Message-ID: E1xJwSG-00000000LYd-1esR@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(at)gmail(dot)com>
Reviewed-by: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Discussion: https://postgr.es/m/CAGRkXqRMkfs25+7ReRkF4WCogEnD1k1=L=fmA_kxbtDfmhFn-g@mail.gmail.com
Backpatch-through: 19

Branch
------
master

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

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

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2026-10-22 17:51:36 pgsql: Accept empty tsquery in binary input.
Previous Message Tom Lane 2026-10-22 16:26:29 pgsql: Clear async.c's isAdvancing flag when a notify read is aborted.