summaryrefslogtreecommitdiff
path: root/src/backend/commands/alter.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/commands/alter.c')
-rw-r--r--src/backend/commands/alter.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/backend/commands/alter.c b/src/backend/commands/alter.c
index 0f4e0f701ab..91df1a0aca7 100644
--- a/src/backend/commands/alter.c
+++ b/src/backend/commands/alter.c
@@ -105,9 +105,8 @@ ExecRenameStmt(RenameStmt *stmt)
{
Oid relid;
- CheckRelationOwnership(stmt->relation, true);
-
relid = RangeVarGetRelid(stmt->relation, false);
+ CheckRelationOwnership(relid, true);
switch (stmt->renameType)
{
@@ -223,7 +222,6 @@ ExecAlterObjectSchemaStmt(AlterObjectSchemaStmt *stmt)
case OBJECT_TABLE:
case OBJECT_VIEW:
case OBJECT_FOREIGN_TABLE:
- CheckRelationOwnership(stmt->relation, true);
AlterTableNamespace(stmt->relation, stmt->newschema,
stmt->objectType, AccessExclusiveLock);
break;