@@ -25,7 +25,7 @@ ALTER TABLESPACE <replaceable>name</replaceable> RENAME TO <replaceable>new_name
25
25
ALTER TABLESPACE <replaceable>name</replaceable> OWNER TO <replaceable>new_owner</replaceable>
26
26
ALTER TABLESPACE <replaceable>name</replaceable> SET ( <replaceable class="PARAMETER">tablespace_option</replaceable> = <replaceable class="PARAMETER">value</replaceable> [, ... ] )
27
27
ALTER TABLESPACE <replaceable>name</replaceable> RESET ( <replaceable class="PARAMETER">tablespace_option</replaceable> [, ... ] )
28
- ALTER TABLESPACE <replaceable>name</replaceable> MOVE { ALL | TABLES | INDEXES | MATERIALIZED VIEWS } TO <replaceable>new_tablespace</replaceable> [ NOWAIT ]
28
+ ALTER TABLESPACE <replaceable>name</replaceable> MOVE { ALL | TABLES | INDEXES | MATERIALIZED VIEWS } [ OWNED BY <replaceable class="PARAMETER">role_name</replaceable> [, ...] ] TO <replaceable>new_tablespace</replaceable> [ NOWAIT ]
29
29
</synopsis>
30
30
</refsynopsisdiv>
31
31
@@ -34,8 +34,8 @@ ALTER TABLESPACE <replaceable>name</replaceable> MOVE { ALL | TABLES | INDEXES |
34
34
35
35
<para>
36
36
<command>ALTER TABLESPACE</command> can be used to change the definition of
37
- a tablespace or to migrate all of the objects in the current database which
38
- are owned by the user out of a given tablespace .
37
+ a tablespace or to migrate objects in the current database between
38
+ tablespaces .
39
39
</para>
40
40
41
41
<para>
@@ -44,13 +44,19 @@ ALTER TABLESPACE <replaceable>name</replaceable> MOVE { ALL | TABLES | INDEXES |
44
44
owning role.
45
45
(Note that superusers have these privileges automatically.)
46
46
47
- Users may use ALTER TABLESPACE ... MOVE to move either ALL of their objects,
48
- or just TABLES, INDEXES, or MATERIALIZED VIEWS, but they must have CREATE
49
- rights on the new tablespace and only objects, directly or indirectly, owned
50
- by the user will be moved. Note that the superuser is considered an owner
51
- of all objects and therefore an ALTER TABLESPACE ... MOVE ALL issued by the
52
- superuser will move all objects in the current database which are in the
53
- tablespace.
47
+ Users may use ALTER TABLESPACE ... MOVE to move objects between tablespaces.
48
+ ALL will move all tables, indexes and materialized views while specifying
49
+ TABLES will move only tables (but not their indexes), INDEXES will only move
50
+ indexes (including those underneath materialized views, but not tables) and
51
+ MATERIALIZED VIEWS will only move the table relation of the materialized
52
+ view (but no indexes associated with it). Users may also specify a list of
53
+ roles whose objects are to be moved using OWNED BY.
54
+
55
+ Users must have CREATE rights on the new tablespace and be considered an
56
+ owner (either directly or indirectly) on all objects to be moved. Note that
57
+ the superuser is considered an owner of all objects and therefore an
58
+ ALTER TABLESPACE ... MOVE ALL issued by the superuser will move all objects
59
+ in the current database which are in the tablespace.
54
60
55
61
All objects to be moved will be locked immediately by the command. The
56
62
NOWAIT option, if specified, will cause the command to fail if it is unable
@@ -115,6 +121,15 @@ ALTER TABLESPACE <replaceable>name</replaceable> MOVE { ALL | TABLES | INDEXES |
115
121
</listitem>
116
122
</varlistentry>
117
123
124
+ <varlistentry>
125
+ <term><replaceable class="parameter">role_name</replaceable></term>
126
+ <listitem>
127
+ <para>
128
+ Role(s) whose objects are to be moved.
129
+ </para>
130
+ </listitem>
131
+ </varlistentry>
132
+
118
133
<varlistentry>
119
134
<term><replaceable class="parameter">new_tablespace</replaceable></term>
120
135
<listitem>
0 commit comments