From 2c31825fb9a95914418f1e376917f60841a26c78 Mon Sep 17 00:00:00 2001 From: Alvaro Herrera Date: Thu, 28 Feb 2019 19:24:21 -0300 Subject: [PATCH] Improve docs for ALTER TABLE .. SET TABLESPACE Discussion: https://postgr.es/m/20190220173815.GA7959@alvherre.pgsql Reviewed-by: Robert Haas --- doc/src/sgml/ref/alter_table.sgml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/doc/src/sgml/ref/alter_table.sgml b/doc/src/sgml/ref/alter_table.sgml index 0aa0f093f2..890b23afd6 100644 --- a/doc/src/sgml/ref/alter_table.sgml +++ b/doc/src/sgml/ref/alter_table.sgml @@ -630,6 +630,13 @@ WITH ( MODULUS numeric_literal, REM moves the data file(s) associated with the table to the new tablespace. Indexes on the table, if any, are not moved; but they can be moved separately with additional SET TABLESPACE commands. + When applied to a partitioned table, nothing is moved, but any + partitions created afterwards with + CREATE TABLE PARTITION OF will use that tablespace, + unless the TABLESPACE clause is used to override it. + + + All tables in the current database in a tablespace can be moved by using the ALL IN TABLESPACE form, which will lock all tables to be moved first and then move each one. This form also supports @@ -637,7 +644,7 @@ WITH ( MODULUS numeric_literal, REM roles specified. If the NOWAIT option is specified then the command will fail if it is unable to acquire all of the locks required immediately. Note that system catalogs are not moved by this - command, use ALTER DATABASE or explicit + command; use ALTER DATABASE or explicit ALTER TABLE invocations instead if desired. The information_schema relations are not considered part of the system catalogs and will be moved. -- 2.40.0