summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Davis2025-06-19 19:43:27 +0000
committerJeff Davis2025-06-19 19:43:27 +0000
commit6c29088fc6e269b7d64797bb62533b82afe03d93 (patch)
tree69aa2a2187037eacb4f679f961ee95738851a536
parented117c4c6c4feb1362abbb417ac6e6525dd8789b (diff)
Correct docs about partitions and EXCLUDE constraints.
In version 17 we added support for cross-partition EXCLUDE constraints, as long as they included all partition key columns and compared them with equality (see 8c852ba9a4). I updated the docs for exclusion constraints, but I missed that the docs for CREATE TABLE still said that they were not supported. This commit fixes that. Author: Paul A. Jungwirth <[email protected]> Co-authored-by: Jeff Davis <[email protected]> Discussion: https://postgr.es/m/[email protected] Backpatch-through: 17
-rw-r--r--doc/src/sgml/ref/create_table.sgml17
1 files changed, 12 insertions, 5 deletions
diff --git a/doc/src/sgml/ref/create_table.sgml b/doc/src/sgml/ref/create_table.sgml
index 4a41b2f5530..a5816918182 100644
--- a/doc/src/sgml/ref/create_table.sgml
+++ b/doc/src/sgml/ref/create_table.sgml
@@ -448,11 +448,6 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
</para>
<para>
- Partitioned tables do not support <literal>EXCLUDE</literal> constraints;
- however, you can define these constraints on individual partitions.
- </para>
-
- <para>
See <xref linkend="ddl-partitioning"/> for more discussion on table
partitioning.
</para>
@@ -1162,6 +1157,18 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
exclusion constraint on a subset of the table; internally this creates a
partial index. Note that parentheses are required around the predicate.
</para>
+
+ <para>
+ When establishing an exclusion constraint for a multi-level partition
+ hierarchy, all the columns in the partition key of the target
+ partitioned table, as well as those of all its descendant partitioned
+ tables, must be included in the constraint definition. Additionally,
+ those columns must be compared using the equality operator. These
+ restrictions ensure that potentially-conflicting rows will exist in the
+ same partition. The constraint may also refer to other columns which
+ are not a part of any partition key, which can be compared using any
+ appropriate operator.
+ </para>
</listitem>
</varlistentry>