summaryrefslogtreecommitdiff
path: root/src/backend/commands
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/commands')
-rw-r--r--src/backend/commands/tablecmds.c16
-rw-r--r--src/backend/commands/tablespace.c4
2 files changed, 7 insertions, 13 deletions
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c
index 96375814a8f..28b178f2089 100644
--- a/src/backend/commands/tablecmds.c
+++ b/src/backend/commands/tablecmds.c
@@ -5960,7 +5960,7 @@ alter_table_type_to_string(AlterTableType cmdtype)
case AT_DropExpression:
return "ALTER COLUMN ... DROP EXPRESSION";
case AT_CheckNotNull:
- return NULL; /* not real grammar */
+ return NULL; /* not real grammar */
case AT_SetStatistics:
return "ALTER COLUMN ... SET STATISTICS";
case AT_SetOptions:
@@ -5976,7 +5976,7 @@ alter_table_type_to_string(AlterTableType cmdtype)
return "DROP COLUMN";
case AT_AddIndex:
case AT_ReAddIndex:
- return NULL; /* not real grammar */
+ return NULL; /* not real grammar */
case AT_AddConstraint:
case AT_AddConstraintRecurse:
case AT_ReAddConstraint:
@@ -5992,7 +5992,7 @@ alter_table_type_to_string(AlterTableType cmdtype)
case AT_DropConstraintRecurse:
return "DROP CONSTRAINT";
case AT_ReAddComment:
- return NULL; /* not real grammar */
+ return NULL; /* not real grammar */
case AT_AlterColumnType:
return "ALTER COLUMN ... SET DATA TYPE";
case AT_AlterColumnGenericOptions:
@@ -6016,7 +6016,7 @@ alter_table_type_to_string(AlterTableType cmdtype)
case AT_ResetRelOptions:
return "RESET";
case AT_ReplaceRelOptions:
- return NULL; /* not real grammar */
+ return NULL; /* not real grammar */
case AT_EnableTrig:
return "ENABLE TRIGGER";
case AT_EnableAlwaysTrig:
@@ -6074,7 +6074,7 @@ alter_table_type_to_string(AlterTableType cmdtype)
case AT_DropIdentity:
return "ALTER COLUMN ... DROP IDENTITY";
case AT_ReAddStatistics:
- return NULL; /* not real grammar */
+ return NULL; /* not real grammar */
}
return NULL;
@@ -6129,7 +6129,7 @@ ATSimplePermissions(AlterTableType cmdtype, Relation rel, int allowed_targets)
if (action_str)
ereport(ERROR,
(errcode(ERRCODE_WRONG_OBJECT_TYPE),
- /* translator: %s is a group of some SQL keywords */
+ /* translator: %s is a group of some SQL keywords */
errmsg("ALTER action %s cannot be performed on relation \"%s\"",
action_str, RelationGetRelationName(rel)),
errdetail_relkind_not_supported(rel->rd_rel->relkind)));
@@ -12080,10 +12080,6 @@ ATExecAlterColumnType(AlteredTableInfo *tab, Relation rel,
Form_pg_depend foundDep = (Form_pg_depend) GETSTRUCT(depTup);
ObjectAddress foundObject;
- /* We don't expect any PIN dependencies on columns */
- if (foundDep->deptype == DEPENDENCY_PIN)
- elog(ERROR, "cannot alter type of a pinned column");
-
foundObject.classId = foundDep->classid;
foundObject.objectId = foundDep->objid;
foundObject.objectSubId = foundDep->objsubid;
diff --git a/src/backend/commands/tablespace.c b/src/backend/commands/tablespace.c
index 69ea155d502..0385fd61214 100644
--- a/src/backend/commands/tablespace.c
+++ b/src/backend/commands/tablespace.c
@@ -449,7 +449,6 @@ DropTableSpace(DropTableSpaceStmt *stmt)
ereport(NOTICE,
(errmsg("tablespace \"%s\" does not exist, skipping",
tablespacename)));
- /* XXX I assume I need one or both of these next two calls */
table_endscan(scandesc);
table_close(rel, NoLock);
}
@@ -465,8 +464,7 @@ DropTableSpace(DropTableSpaceStmt *stmt)
tablespacename);
/* Disallow drop of the standard tablespaces, even by superuser */
- if (tablespaceoid == GLOBALTABLESPACE_OID ||
- tablespaceoid == DEFAULTTABLESPACE_OID)
+ if (IsPinnedObject(TableSpaceRelationId, tablespaceoid))
aclcheck_error(ACLCHECK_NO_PRIV, OBJECT_TABLESPACE,
tablespacename);