summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorStephen Frost2014-08-21 23:06:17 +0000
committerStephen Frost2014-08-21 23:12:00 +0000
commitd9b2bc45cf75f913490f1b3ce9b9263509b26704 (patch)
tree5245060be317d1a40da7398838b8e9bc5dd7751c /src/include
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/include')
-rw-r--r--src/include/commands/tablecmds.h2
-rw-r--r--src/include/commands/tablespace.h1
-rw-r--r--src/include/nodes/nodes.h2
-rw-r--r--src/include/nodes/parsenodes.h7
4 files changed, 6 insertions, 6 deletions
diff --git a/src/include/commands/tablecmds.h b/src/include/commands/tablecmds.h
index e55f45ab26f..932322f144c 100644
--- a/src/include/commands/tablecmds.h
+++ b/src/include/commands/tablecmds.h
@@ -35,6 +35,8 @@ extern void ATExecChangeOwner(Oid relationOid, Oid newOwnerId, bool recursing, L
extern void AlterTableInternal(Oid relid, List *cmds, bool recurse);
+extern Oid AlterTableMoveAll(AlterTableMoveAllStmt *stmt);
+
extern Oid AlterTableNamespace(AlterObjectSchemaStmt *stmt);
extern void AlterTableNamespaceInternal(Relation rel, Oid oldNspOid,
diff --git a/src/include/commands/tablespace.h b/src/include/commands/tablespace.h
index 1603f677a7d..c7af55917d7 100644
--- a/src/include/commands/tablespace.h
+++ b/src/include/commands/tablespace.h
@@ -43,7 +43,6 @@ extern Oid CreateTableSpace(CreateTableSpaceStmt *stmt);
extern void DropTableSpace(DropTableSpaceStmt *stmt);
extern Oid RenameTableSpace(const char *oldname, const char *newname);
extern Oid AlterTableSpaceOptions(AlterTableSpaceOptionsStmt *stmt);
-extern Oid AlterTableSpaceMove(AlterTableSpaceMoveStmt *stmt);
extern void TablespaceCreateDbspace(Oid spcNode, Oid dbNode, bool isRedo);
diff --git a/src/include/nodes/nodes.h b/src/include/nodes/nodes.h
index bc58e165258..5dcc66f27ff 100644
--- a/src/include/nodes/nodes.h
+++ b/src/include/nodes/nodes.h
@@ -354,7 +354,7 @@ typedef enum NodeTag
T_AlterUserMappingStmt,
T_DropUserMappingStmt,
T_AlterTableSpaceOptionsStmt,
- T_AlterTableSpaceMoveStmt,
+ T_AlterTableMoveAllStmt,
T_SecLabelStmt,
T_CreateForeignTableStmt,
T_CreateExtensionStmt,
diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h
index 7e560a19a3b..3146aa53ed1 100644
--- a/src/include/nodes/parsenodes.h
+++ b/src/include/nodes/parsenodes.h
@@ -1689,16 +1689,15 @@ typedef struct AlterTableSpaceOptionsStmt
bool isReset;
} AlterTableSpaceOptionsStmt;
-typedef struct AlterTableSpaceMoveStmt
+typedef struct AlterTableMoveAllStmt
{
NodeTag type;
char *orig_tablespacename;
- ObjectType objtype; /* set to -1 if move_all is true */
- bool move_all; /* move all, or just objtype objects? */
+ ObjectType objtype; /* Object type to move */
List *roles; /* List of roles to move objects of */
char *new_tablespacename;
bool nowait;
-} AlterTableSpaceMoveStmt;
+} AlterTableMoveAllStmt;
/* ----------------------
* Create/Alter Extension Statements