@@ -49,7 +49,7 @@ static void AlterSchemaOwner_internal(HeapTuple tup, Relation rel, Oid newOwnerI
4949 * a subquery.
5050 */
5151Oid
52- CreateSchemaCommand (CreateSchemaStmt * stmt , const char * queryString ,
52+ CreateSchemaCommand (ParseState * pstate , CreateSchemaStmt * stmt ,
5353 int stmt_location , int stmt_len )
5454{
5555 const char * schemaName = stmt -> schemaname ;
@@ -189,12 +189,13 @@ CreateSchemaCommand(CreateSchemaStmt *stmt, const char *queryString,
189189
190190 /*
191191 * Examine the list of commands embedded in the CREATE SCHEMA command, and
192- * reorganize them into a sequentially executable order with no forward
193- * references . Note that the result is still a list of raw parsetrees ---
194- * we cannot, in general, run parse analysis on one statement until we
195- * have actually executed the prior ones.
192+ * do preliminary transformations (mostly, verify that none are trying to
193+ * create objects outside the new schema) . Note that the result is still
194+ * a list of raw parsetrees --- we cannot, in general, run parse analysis
195+ * on one statement until we have actually executed the prior ones.
196196 */
197- parsetree_list = transformCreateSchemaStmtElements (stmt -> schemaElts ,
197+ parsetree_list = transformCreateSchemaStmtElements (pstate ,
198+ stmt -> schemaElts ,
198199 schemaName );
199200
200201 /*
@@ -219,7 +220,7 @@ CreateSchemaCommand(CreateSchemaStmt *stmt, const char *queryString,
219220
220221 /* do this step */
221222 ProcessUtility (wrapper ,
222- queryString ,
223+ pstate -> p_sourcetext ,
223224 false,
224225 PROCESS_UTILITY_SUBCOMMAND ,
225226 NULL ,
0 commit comments