diff options
Diffstat (limited to 'src/backend/commands')
| -rw-r--r-- | src/backend/commands/cluster.c | 3 | ||||
| -rw-r--r-- | src/backend/commands/tablecmds.c | 29 |
2 files changed, 5 insertions, 27 deletions
diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c index ff228b7d531..191ef543cd2 100644 --- a/src/backend/commands/cluster.c +++ b/src/backend/commands/cluster.c @@ -646,8 +646,7 @@ make_new_heap(Oid OIDOldHeap, Oid NewTableSpace) ONCOMMIT_NOOP, reloptions, false, - true, - false); + true); Assert(OIDNewHeap != InvalidOid); ReleaseSysCache(tuple); diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index 7660114ec2c..60eecb14976 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -439,22 +439,10 @@ DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId) errmsg("cannot create temporary table within security-restricted operation"))); /* - * Look up the namespace in which we are supposed to create the relation. - * Check we have permission to create there. Skip check if bootstrapping, - * since permissions machinery may not be working yet. + * Look up the namespace in which we are supposed to create the relation, + * and check we have permission to create there. */ - namespaceId = RangeVarGetCreationNamespace(stmt->relation); - - if (!IsBootstrapProcessingMode()) - { - AclResult aclresult; - - aclresult = pg_namespace_aclcheck(namespaceId, GetUserId(), - ACL_CREATE); - if (aclresult != ACLCHECK_OK) - aclcheck_error(aclresult, ACL_KIND_NAMESPACE, - get_namespace_name(namespaceId)); - } + namespaceId = RangeVarGetAndCheckCreationNamespace(stmt->relation); /* * Select tablespace to use. If not specified, use default tablespace @@ -602,16 +590,7 @@ DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId) stmt->oncommit, reloptions, true, - allowSystemTableMods, - stmt->if_not_exists); - - /* - * If heap_create_with_catalog returns InvalidOid, it means that the user - * specified "IF NOT EXISTS" and the relation already exists. In that - * case we do nothing further. - */ - if (relationId == InvalidOid) - return InvalidOid; + allowSystemTableMods); /* Store inheritance information for new rel. */ StoreCatalogInheritance(relationId, inheritOids); |
