aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2017-03-09 13:09:48 -0500
committerRobert Haas <rhaas@postgresql.org>2017-03-09 13:13:15 -0500
commitb54aad8e34bd6299093e965c50f4a23da96d7cc3 (patch)
tree1acb8eeb139342bcd884c512b1de223923d09af5
parent054637d2e08cda6a096f48cc99696136a06f4ef5 (diff)
downloadpostgresql-b54aad8e34bd6299093e965c50f4a23da96d7cc3.tar.gz
postgresql-b54aad8e34bd6299093e965c50f4a23da96d7cc3.zip
Document lack of validation when attaching foreign partitions.
Ashutosh Bapat, revised a bit by me. Discussion: http://postgr.es/m/CAFjFpRdLaCa-1wJase0=YWG5o3cJnbuUt_vrqm2TDBKM_vQ_oA@mail.gmail.com
-rw-r--r--doc/src/sgml/ref/alter_table.sgml31
1 files changed, 19 insertions, 12 deletions
diff --git a/doc/src/sgml/ref/alter_table.sgml b/doc/src/sgml/ref/alter_table.sgml
index 8b251f9e5d7..077c00373d1 100644
--- a/doc/src/sgml/ref/alter_table.sgml
+++ b/doc/src/sgml/ref/alter_table.sgml
@@ -743,18 +743,25 @@ ALTER TABLE [ IF EXISTS ] <replaceable class="PARAMETER">name</replaceable>
</para>
<para>
- A full table scan is performed on the table being attached to check that
- no existing row in the table violates the partition constraint. It is
- possible to avoid this scan by adding a valid <literal>CHECK</literal>
- constraint to the table that would allow only the rows satisfying the
- desired partition constraint before running this command. It will be
- determined using such a constraint that the table need not be scanned
- to validate the partition constraint. This does not work, however, if
- any of the partition keys is an expression and the partition does not
- accept <literal>NULL</literal> values. If attaching a list partition
- that will not accept <literal>NULL</literal> values, also add
- <literal>NOT NULL</literal> constraint to the partition key column,
- unless it's an expression.
+ 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
+ constraint. It is possible to avoid this scan by adding a valid
+ <literal>CHECK</literal> constraint to the table that would allow only
+ the rows satisfying the desired partition constraint before running this
+ command. It will be determined using such a constraint that the table
+ need not be scanned to validate the partition constraint. This does not
+ work, however, if any of the partition keys is an expression and the
+ partition does not accept <literal>NULL</literal> values. If attaching
+ a list partition that will not accept <literal>NULL</literal> values,
+ also add <literal>NOT NULL</literal> constraint to the partition key
+ column, unless it's an expression.
+ </para>
+
+ <para>
+ If the new partition is a foreign table, nothing is done to verify
+ that all the rows in the foreign table obey the partition constraint.
+ (See the discussion in <xref linkend="SQL-CREATEFOREIGNTABLE"> about
+ constraints on the foreign table.)
</para>
</listitem>
</varlistentry>