Content-Length: 289908 | pFad | http://github.com/postgres/postgres/commit/0f5ac7f321fbe19e666b5c5f19218f6ff5cd8c83

85 Correct docs about partitions and EXCLUDE constraints. · postgres/postgres@0f5ac7f · GitHub
Skip to content

Commit 0f5ac7f

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 2550508 commit 0f5ac7f

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
@@ -442,11 +442,6 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
442442
the values in the new row, an error will be reported.
443443
</para>
444444

445-
<para>
446-
Partitioned tables do not support <literal>EXCLUDE</literal> constraints;
447-
however, you can define these constraints on individual partitions.
448-
</para>
449-
450445
<para>
451446
See <xref linkend="ddl-partitioning"/> for more discussion on table
452447
partitioning.
@@ -1125,6 +1120,18 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
11251120
exclusion constraint on a subset of the table; internally this creates a
11261121
partial index. Note that parentheses are required around the predicate.
11271122
</para>
1123+
1124+
<para>
1125+
When establishing an exclusion constraint for a multi-level partition
1126+
hierarchy, all the columns in the partition key of the target
1127+
partitioned table, as well as those of all its descendant partitioned
1128+
tables, must be included in the constraint definition. Additionally,
1129+
those columns must be compared using the equality operator. These
1130+
restrictions ensure that potentially-conflicting rows will exist in the
1131+
same partition. The constraint may also refer to other columns which
1132+
are not a part of any partition key, which can be compared using any
1133+
appropriate operator.
1134+
</para>
11281135
</listitem>
11291136
</varlistentry>
11301137

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgres/postgres/commit/0f5ac7f321fbe19e666b5c5f19218f6ff5cd8c83

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy