@@ -25,7 +25,7 @@ ALTER TABLESPACE <replaceable>name</replaceable> RENAME TO <replaceable>new_name
2525ALTER TABLESPACE <replaceable>name</replaceable> OWNER TO <replaceable>new_owner</replaceable>
2626ALTER TABLESPACE <replaceable>name</replaceable> SET ( <replaceable class="PARAMETER">tablespace_option</replaceable> = <replaceable class="PARAMETER">value</replaceable> [, ... ] )
2727ALTER 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 ]
2929</synopsis>
3030 </refsynopsisdiv>
3131
@@ -34,8 +34,8 @@ ALTER TABLESPACE <replaceable>name</replaceable> MOVE { ALL | TABLES | INDEXES |
3434
3535 <para>
3636 <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 .
3939 </para>
4040
4141 <para>
@@ -44,13 +44,19 @@ ALTER TABLESPACE <replaceable>name</replaceable> MOVE { ALL | TABLES | INDEXES |
4444 owning role.
4545 (Note that superusers have these privileges automatically.)
4646
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.
5460
5561 All objects to be moved will be locked immediately by the command. The
5662 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 |
115121 </listitem>
116122 </varlistentry>
117123
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+
118133 <varlistentry>
119134 <term><replaceable class="parameter">new_tablespace</replaceable></term>
120135 <listitem>
0 commit comments