Skip to content

Commit 2c31825

Browse files
committed
Improve docs for ALTER TABLE .. SET TABLESPACE
Discussion: https://postgr.es/m/20190220173815.GA7959@alvherre.pgsql Reviewed-by: Robert Haas
1 parent 4598a99 commit 2c31825

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

doc/src/sgml/ref/alter_table.sgml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,14 +630,21 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
630630
moves the data file(s) associated with the table to the new tablespace.
631631
Indexes on the table, if any, are not moved; but they can be moved
632632
separately with additional <literal>SET TABLESPACE</literal> commands.
633+
When applied to a partitioned table, nothing is moved, but any
634+
partitions created afterwards with
635+
<command>CREATE TABLE PARTITION OF</command> will use that tablespace,
636+
unless the <literal>TABLESPACE</literal> clause is used to override it.
637+
</para>
638+
639+
<para>
633640
All tables in the current database in a tablespace can be moved by using
634641
the <literal>ALL IN TABLESPACE</literal> form, which will lock all tables
635642
to be moved first and then move each one. This form also supports
636643
<literal>OWNED BY</literal>, which will only move tables owned by the
637644
roles specified. If the <literal>NOWAIT</literal> option is specified
638645
then the command will fail if it is unable to acquire all of the locks
639646
required immediately. Note that system catalogs are not moved by this
640-
command, use <command>ALTER DATABASE</command> or explicit
647+
command; use <command>ALTER DATABASE</command> or explicit
641648
<command>ALTER TABLE</command> invocations instead if desired. The
642649
<literal>information_schema</literal> relations are not considered part
643650
of the system catalogs and will be moved.

0 commit comments

Comments
 (0)