From 76e91b38ba64e1da70ea21744b342cb105ea3400 Mon Sep 17 00:00:00 2001 From: Stephen Frost Date: Sat, 18 Jan 2014 18:56:40 -0500 Subject: Add ALTER TABLESPACE ... MOVE command This adds a 'MOVE' sub-command to ALTER TABLESPACE which allows moving sets of objects from one tablespace to another. This can be extremely handy and avoids a lot of error-prone scripting. ALTER TABLESPACE ... MOVE will only move objects the user owns, will notify the user if no objects were found, and can be used to move ALL objects or specific types of objects (TABLES, INDEXES, or MATERIALIZED VIEWS). --- src/include/nodes/nodes.h | 1 + src/include/nodes/parsenodes.h | 10 ++++++++++ 2 files changed, 11 insertions(+) (limited to 'src/include/nodes') diff --git a/src/include/nodes/nodes.h b/src/include/nodes/nodes.h index ae12c0de03..dfcc01344e 100644 --- a/src/include/nodes/nodes.h +++ b/src/include/nodes/nodes.h @@ -354,6 +354,7 @@ typedef enum NodeTag T_AlterUserMappingStmt, T_DropUserMappingStmt, T_AlterTableSpaceOptionsStmt, + T_AlterTableSpaceMoveStmt, T_SecLabelStmt, T_CreateForeignTableStmt, T_CreateExtensionStmt, diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h index 9a3a5d76cc..f86edc61c3 100644 --- a/src/include/nodes/parsenodes.h +++ b/src/include/nodes/parsenodes.h @@ -1686,6 +1686,16 @@ typedef struct AlterTableSpaceOptionsStmt bool isReset; } AlterTableSpaceOptionsStmt; +typedef struct AlterTableSpaceMoveStmt +{ + NodeTag type; + char *orig_tablespacename; + char *new_tablespacename; + ObjectType objtype; + bool nowait; + bool move_all; +} AlterTableSpaceMoveStmt; + /* ---------------------- * Create/Alter Extension Statements * ---------------------- -- cgit v1.2.3