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 <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: 
https://postgr.es/m/CAGRkXqRMkfs25+7ReRkF4WCogEnD1k1=L=fma_kxbtdfmhf...@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(-)

Reply via email to