pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Qualify unqualified names in CREATE SCHEMA elements again.
2+ messages / 1 participants
[nested] [flat]

* pgsql: Qualify unqualified names in CREATE SCHEMA elements again.
@ 2026-10-22 17:19  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2026-10-22 17:19 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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
------
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(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: Qualify unqualified names in CREATE SCHEMA elements again.
@ 2026-10-22 17:19  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2026-10-22 17:19 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2026-10-22 17:19 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-10-22 17:19 pgsql: Qualify unqualified names in CREATE SCHEMA elements again. Tom Lane <tgl@sss.pgh.pa.us>
2026-10-22 17:19 pgsql: Qualify unqualified names in CREATE SCHEMA elements again. Tom Lane <tgl@sss.pgh.pa.us>

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