postgres.git / summary / log / commit / refs
commit 56f2b0b5334df68b16964d4f9a0cbe9dae913227
Author: Michael Paquier <michael@paquier.xyz>
Date: Tue Jun 23 07:49:34 2026 +0000
First released in: 19.0, 14.24, 15.19, 16.15, 17.11, 18.6
doc: Describe better handling of indexes in ALTER TABLE ATTACH PARTITION
When ALTER TABLE ... ATTACH PARTITION matches partition indexes to the
parent table's indexes, invalid indexes are skipped. This commit
improves the documentation to describe what e90e9275f56 has changed:
invalid indexes are skipped, and only valid indexes are considered for a
match.
Author: Mohamed Ali <moali.pg@gmail.com>
Reviewed-by: Sami Imseih <samimseih@gmail.com>
Discussion: https://postgr.es/m/CAGnOmWpAMaE-BOkpwM6mJnHcpS2QZ8yLSSaqmz+vryEsbCWWWA@mail.gmail.com
Backpatch-through: 14
doc/src/sgml/ref/alter_table.sgml | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/doc/src/sgml/ref/alter_table.sgml b/doc/src/sgml/ref/alter_table.sgml
index dec34337d1a..4ca91f81d34 100644
--- a/doc/src/sgml/ref/alter_table.sgml
+++ b/doc/src/sgml/ref/alter_table.sgml
@@ -1054,10 +1054,11 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
as a partition of the target table. The table can be attached
as a partition for specific values using <literal>FOR VALUES</literal>
or as a default partition by using <literal>DEFAULT</literal>.
- For each index in the target table, a corresponding
- one will be created in the attached table; or, if an equivalent
- index already exists, it will be attached to the target table's index,
- as if <command>ALTER INDEX ATTACH PARTITION</command> had been executed.
+ For each index in the target table, if a valid equivalent index
+ already exists in the partition, it will be attached to the target
+ table's index, as if ALTER INDEX ATTACH PARTITION had been executed;
+ otherwise, a new corresponding index will be created. Invalid indexes
+ on the partition are skipped.
Note that if the existing table is a foreign table, it is currently not
allowed to attach the table as a partition of the target table if there
are <literal>UNIQUE</literal> indexes on the target table. (See also
[parent: 2a7e95b659df]