diff options
| author | Stephen Frost | 2014-01-18 23:56:40 +0000 |
|---|---|---|
| committer | Stephen Frost | 2014-01-18 23:56:40 +0000 |
| commit | 76e91b38ba64e1da70ea21744b342cb105ea3400 (patch) | |
| tree | bc485da708d31d5484d5a3de6489cf73684a9640 /src/backend/nodes/equalfuncs.c | |
| parent | 6f25c62d788ea6312fe718ed57a3d169d8efc066 (diff) | |
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).
Diffstat (limited to 'src/backend/nodes/equalfuncs.c')
| -rw-r--r-- | src/backend/nodes/equalfuncs.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/backend/nodes/equalfuncs.c b/src/backend/nodes/equalfuncs.c index ccf726741d8..55c548d5e49 100644 --- a/src/backend/nodes/equalfuncs.c +++ b/src/backend/nodes/equalfuncs.c @@ -1635,6 +1635,17 @@ _equalAlterTableSpaceOptionsStmt(const AlterTableSpaceOptionsStmt *a, } static bool +_equalAlterTableSpaceMoveStmt(const AlterTableSpaceMoveStmt *a, + const AlterTableSpaceMoveStmt *b) +{ + COMPARE_STRING_FIELD(orig_tablespacename); + COMPARE_STRING_FIELD(new_tablespacename); + COMPARE_SCALAR_FIELD(nowait); + + return true; +} + +static bool _equalCreateExtensionStmt(const CreateExtensionStmt *a, const CreateExtensionStmt *b) { COMPARE_STRING_FIELD(extname); @@ -2877,6 +2888,9 @@ equal(const void *a, const void *b) case T_AlterTableSpaceOptionsStmt: retval = _equalAlterTableSpaceOptionsStmt(a, b); break; + case T_AlterTableSpaceMoveStmt: + retval = _equalAlterTableSpaceMoveStmt(a, b); + break; case T_CreateExtensionStmt: retval = _equalCreateExtensionStmt(a, b); break; |
