@ -841,7 +841,7 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
or as a default partition by using <literal>DEFAULT</literal>.
or as a default partition by using <literal>DEFAULT</literal>.
For each index in the target table, a corresponding
For each index in the target table, a corresponding
one will be created in the attached table; or, if an equivalent
one will be created in the attached table; or, if an equivalent
index already exists, will be attached to the target table's index,
index already exists, it will be attached to the target table's index,
as if <command>ALTER INDEX ATTACH PARTITION</command> had been executed.
as if <command>ALTER INDEX ATTACH PARTITION</command> had been executed.
Note that if the existing table is a foreign table, it is currently not
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
allowed to attach the table as a partition of the target table if there
@ -864,23 +864,24 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
already exist.
already exist.
If any of the <literal>CHECK</literal> constraints of the table being
If any of the <literal>CHECK</literal> constraints of the table being
attached is marked <literal>NO INHERIT</literal>, the command will fail;
attached is marked <literal>NO INHERIT</literal>, the command will fail;
such a constraint must be recreated without the <literal>NO INHERIT</literal>
such constraints must be recreated without the
clause.
<literal>NO INHERIT</literal> clause.
</para>
</para>
<para>
<para>
If the new partition is a regular table, a full table scan is performed
If the new partition is a regular table, a full table scan is performed
to check that no existing row in the table violates the partition
to check that existing rows in the table do not violate the partition
constraint. It is possible to avoid this scan by adding a valid
constraint. It is possible to avoid this scan by adding a valid
<literal>CHECK</literal> constraint to the table that would allow only
<literal>CHECK</literal> constraint to the table that allows only
the rows satisfying the desired partition constraint before running this
rows satisfying the desired partition constraint before running this
command. It will be determined using such a constraint that the table
command. The <literal>CHECK</literal> constraint will be used to
need not be scanned to validate the partition constraint. This does not
determine that the table need not be scanned to validate the partition
work, however, if any of the partition keys is an expression and the
constraint. This does not work, however, if any of the partition keys
partition does not accept <literal>NULL</literal> values. If attaching
is an expression and the partition does not accept
a list partition that will not accept <literal>NULL</literal> values,
<literal>NULL</literal> values. If attaching a list partition that will
also add <literal>NOT NULL</literal> constraint to the partition key
not accept <literal>NULL</literal> values, also add
column, unless it's an expression.
<literal>NOT NULL</literal> constraint to the partition key column,
unless it's an expression.
</para>
</para>
<para>
<para>