aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/tablecmds.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/commands/tablecmds.c')
-rw-r--r--src/backend/commands/tablecmds.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c
index cd2c9610085..fe328349533 100644
--- a/src/backend/commands/tablecmds.c
+++ b/src/backend/commands/tablecmds.c
@@ -10518,19 +10518,16 @@ RangeVarCallbackForAlterRelation(const RangeVar *rv, Oid relid, Oid oldrelid,
errmsg("\"%s\" is a composite type", rv->relname),
errhint("Use ALTER TYPE instead.")));
- if (reltype != OBJECT_FOREIGN_TABLE && relkind == RELKIND_FOREIGN_TABLE)
- ereport(ERROR,
- (errcode(ERRCODE_WRONG_OBJECT_TYPE),
- errmsg("\"%s\" is a foreign table", rv->relname),
- errhint("Use ALTER FOREIGN TABLE instead.")));
-
/*
* Don't allow ALTER TABLE .. SET SCHEMA on relations that can't be moved
* to a different schema, such as indexes and TOAST tables.
*/
- if (IsA(stmt, AlterObjectSchemaStmt) && relkind != RELKIND_RELATION
- && relkind != RELKIND_VIEW && relkind != RELKIND_MATVIEW
- && relkind != RELKIND_SEQUENCE && relkind != RELKIND_FOREIGN_TABLE)
+ if (IsA(stmt, AlterObjectSchemaStmt) &&
+ relkind != RELKIND_RELATION &&
+ relkind != RELKIND_VIEW &&
+ relkind != RELKIND_MATVIEW &&
+ relkind != RELKIND_SEQUENCE &&
+ relkind != RELKIND_FOREIGN_TABLE)
ereport(ERROR,
(errcode(ERRCODE_WRONG_OBJECT_TYPE),
errmsg("\"%s\" is not a table, view, sequence, or foreign table",