Skip to content

Commit 6c29088

Browse files
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 8c852ba). 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 <pj@illuminatedcomputing.com> Co-authored-by: Jeff Davis <pgsql@j-davis.com> Discussion: https://postgr.es/m/c955d292-b92d-42d1-a2a0-1ec6715a2546@illuminatedcomputing.com Backpatch-through: 17
1 parent ed117c4 commit 6c29088

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

doc/src/sgml/ref/create_table.sgml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -447,11 +447,6 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
447447
the values in the new row, an error will be reported.
448448
</para>
449449

450-
<para>
451-
Partitioned tables do not support <literal>EXCLUDE</literal> constraints;
452-
however, you can define these constraints on individual partitions.
453-
</para>
454-
455450
<para>
456451
See <xref linkend="ddl-partitioning"/> for more discussion on table
457452
partitioning.
@@ -1162,6 +1157,18 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
11621157
exclusion constraint on a subset of the table; internally this creates a
11631158
partial index. Note that parentheses are required around the predicate.
11641159
</para>
1160+
1161+
<para>
1162+
When establishing an exclusion constraint for a multi-level partition
1163+
hierarchy, all the columns in the partition key of the target
1164+
partitioned table, as well as those of all its descendant partitioned
1165+
tables, must be included in the constraint definition. Additionally,
1166+
those columns must be compared using the equality operator. These
1167+
restrictions ensure that potentially-conflicting rows will exist in the
1168+
same partition. The constraint may also refer to other columns which
1169+
are not a part of any partition key, which can be compared using any
1170+
appropriate operator.
1171+
</para>
11651172
</listitem>
11661173
</varlistentry>
11671174

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy