summaryrefslogtreecommitdiff
path: root/src/backend/tcop/utility.c
diff options
context:
space:
mode:
authorStephen Frost <sfrost@snowman.net>2014-08-21 19:06:17 -0400
committerStephen Frost <sfrost@snowman.net>2014-08-21 19:12:00 -0400
commitd9b2bc45cf75f913490f1b3ce9b9263509b26704 (patch)
tree5245060be317d1a40da7398838b8e9bc5dd7751c /src/backend/tcop/utility.c
parent9243417801be3f1cfaa3a3c33d5a003f382bd7a4 (diff)
Rework 'MOVE ALL' to 'ALTER .. ALL IN TABLESPACE'
As 'ALTER TABLESPACE .. MOVE ALL' really didn't change the tablespace but instead changed objects inside tablespaces, it made sense to rework the syntax and supporting functions to operate under the 'ALTER (TABLE|INDEX|MATERIALIZED VIEW)' syntax and to be in tablecmds.c. Pointed out by Alvaro, who also suggested the new syntax. Back-patch to 9.4.
Diffstat (limited to 'src/backend/tcop/utility.c')
-rw-r--r--src/backend/tcop/utility.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/backend/tcop/utility.c b/src/backend/tcop/utility.c
index 3423898c112..0558ea34b05 100644
--- a/src/backend/tcop/utility.c
+++ b/src/backend/tcop/utility.c
@@ -147,6 +147,7 @@ check_xact_readonly(Node *parsetree)
case T_AlterObjectSchemaStmt:
case T_AlterOwnerStmt:
case T_AlterSeqStmt:
+ case T_AlterTableMoveAllStmt:
case T_AlterTableStmt:
case T_RenameStmt:
case T_CommentStmt:
@@ -200,7 +201,6 @@ check_xact_readonly(Node *parsetree)
case T_AlterUserMappingStmt:
case T_DropUserMappingStmt:
case T_AlterTableSpaceOptionsStmt:
- case T_AlterTableSpaceMoveStmt:
case T_CreateForeignTableStmt:
case T_SecLabelStmt:
PreventCommandIfReadOnly(CreateCommandTag(parsetree));
@@ -506,9 +506,8 @@ standard_ProcessUtility(Node *parsetree,
AlterTableSpaceOptions((AlterTableSpaceOptionsStmt *) parsetree);
break;
- case T_AlterTableSpaceMoveStmt:
- /* no event triggers for global objects */
- AlterTableSpaceMove((AlterTableSpaceMoveStmt *) parsetree);
+ case T_AlterTableMoveAllStmt:
+ AlterTableMoveAll((AlterTableMoveAllStmt *) parsetree);
break;
case T_TruncateStmt:
@@ -1805,10 +1804,6 @@ CreateCommandTag(Node *parsetree)
tag = "ALTER TABLESPACE";
break;
- case T_AlterTableSpaceMoveStmt:
- tag = "ALTER TABLESPACE";
- break;
-
case T_CreateExtensionStmt:
tag = "CREATE EXTENSION";
break;
@@ -1973,6 +1968,10 @@ CreateCommandTag(Node *parsetree)
tag = AlterObjectTypeCommandTag(((AlterOwnerStmt *) parsetree)->objectType);
break;
+ case T_AlterTableMoveAllStmt:
+ tag = AlterObjectTypeCommandTag(((AlterTableMoveAllStmt *) parsetree)->objtype);
+ break;
+
case T_AlterTableStmt:
tag = AlterObjectTypeCommandTag(((AlterTableStmt *) parsetree)->relkind);
break;
@@ -2501,10 +2500,6 @@ GetCommandLogLevel(Node *parsetree)
lev = LOGSTMT_DDL;
break;
- case T_AlterTableSpaceMoveStmt:
- lev = LOGSTMT_DDL;
- break;
-
case T_CreateExtensionStmt:
case T_AlterExtensionStmt:
case T_AlterExtensionContentsStmt:
@@ -2583,6 +2578,7 @@ GetCommandLogLevel(Node *parsetree)
lev = LOGSTMT_DDL;
break;
+ case T_AlterTableMoveAllStmt:
case T_AlterTableStmt:
lev = LOGSTMT_DDL;
break;