errmsg("constraints on foreign tables are not supported")));
/*
+ * Look up the namespace in which we are supposed to create the relation,
+ * and check we have permission to create there.
+ */
+ namespaceId = RangeVarGetAndCheckCreationNamespace(stmt->relation);
+ RangeVarAdjustRelationPersistence(stmt->relation, namespaceId);
+
+ /*
* Security check: disallow creating temp tables from security-restricted
* code. This is needed because calling code might not expect untrusted
* tables to appear in pg_temp at the front of its search path.
errmsg("cannot create temporary table within security-restricted operation")));
/*
- * Look up the namespace in which we are supposed to create the relation,
- * and check we have permission to create there.
- */
- namespaceId = RangeVarGetAndCheckCreationNamespace(stmt->relation);
-
- /*
* Select tablespace to use. If not specified, use default tablespace
* (which may in turn default to database's default).
*/