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:06:17 -0400
commit3c4cf080879b386d4ed1814667aca025caafe608 (patch)
treeec530d19313baddf3ff3ee8aa693c5f4f0326b32 /src/backend/tcop/utility.c
parentf57791985ac3d776cb67e9d69befde538cfdf13b (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 07e0b987212..f648945ffa3 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_ImportForeignSchemaStmt:
case T_SecLabelStmt:
@@ -507,9 +507,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:
@@ -1810,10 +1809,6 @@ CreateCommandTag(Node *parsetree)
tag = "ALTER TABLESPACE";
break;
- case T_AlterTableSpaceMoveStmt:
- tag = "ALTER TABLESPACE";
- break;
-
case T_CreateExtensionStmt:
tag = "CREATE EXTENSION";
break;
@@ -1982,6 +1977,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;
@@ -2510,10 +2509,6 @@ GetCommandLogLevel(Node *parsetree)
lev = LOGSTMT_DDL;
break;
- case T_AlterTableSpaceMoveStmt:
- lev = LOGSTMT_DDL;
- break;
-
case T_CreateExtensionStmt:
case T_AlterExtensionStmt:
case T_AlterExtensionContentsStmt:
@@ -2593,6 +2588,7 @@ GetCommandLogLevel(Node *parsetree)
lev = LOGSTMT_DDL;
break;
+ case T_AlterTableMoveAllStmt:
case T_AlterTableStmt:
lev = LOGSTMT_DDL;
break;