mirror of
https://github.com/postgres/postgres.git
synced 2025-08-27 07:42:10 +03:00
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.
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user