From d9b2bc45cf75f913490f1b3ce9b9263509b26704 Mon Sep 17 00:00:00 2001 From: Stephen Frost Date: Thu, 21 Aug 2014 19:06:17 -0400 Subject: 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. --- src/backend/nodes/copyfuncs.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/backend/nodes/copyfuncs.c') diff --git a/src/backend/nodes/copyfuncs.c b/src/backend/nodes/copyfuncs.c index 43530aa24a8..221d0fee6bb 100644 --- a/src/backend/nodes/copyfuncs.c +++ b/src/backend/nodes/copyfuncs.c @@ -3402,14 +3402,13 @@ _copyAlterTableSpaceOptionsStmt(const AlterTableSpaceOptionsStmt *from) return newnode; } -static AlterTableSpaceMoveStmt * -_copyAlterTableSpaceMoveStmt(const AlterTableSpaceMoveStmt *from) +static AlterTableMoveAllStmt * +_copyAlterTableMoveAllStmt(const AlterTableMoveAllStmt *from) { - AlterTableSpaceMoveStmt *newnode = makeNode(AlterTableSpaceMoveStmt); + AlterTableMoveAllStmt *newnode = makeNode(AlterTableMoveAllStmt); COPY_STRING_FIELD(orig_tablespacename); COPY_SCALAR_FIELD(objtype); - COPY_SCALAR_FIELD(move_all); COPY_NODE_FIELD(roles); COPY_STRING_FIELD(new_tablespacename); COPY_SCALAR_FIELD(nowait); @@ -4428,8 +4427,8 @@ copyObject(const void *from) case T_AlterTableSpaceOptionsStmt: retval = _copyAlterTableSpaceOptionsStmt(from); break; - case T_AlterTableSpaceMoveStmt: - retval = _copyAlterTableSpaceMoveStmt(from); + case T_AlterTableMoveAllStmt: + retval = _copyAlterTableMoveAllStmt(from); break; case T_CreateExtensionStmt: retval = _copyCreateExtensionStmt(from); -- cgit v1.2.3