Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb70db6c

Browse files
committed
Doc: clarify partitioned table limitations
Improve documentation regarding the limitations of unique and primary keyconstraints on partitioned tables. The existing documentation didn't makeit clear that the constraint columns had to be present in the partitionkey as bare columns. The reader could be led to believe that it was ok toinclude the constraint columns as part of a function call's parameters oras part of an expression. Additionally, the documentation didn't mentionanything about the fact that we disallow unique and primary keyconstraints if the partition keys contain *any* function calls orexpressions, regardless of if the constraint columns appear as columnselsewhere in the partition key.The confusion here was highlighted by a report on the general mailing listby James Vanns.Discussion:https://postgr.es/m/CAH7vdhNF0EdYZz3GLpgE3RSJLwWLhEk7A_fiKS9dPBT3Dz_3eA@mail.gmail.comDiscussion:https://postgr.es/m/CAApHDvoU-u9iTqKjteYRFfi+UNEk7dbSAcyxEQD==vZt9B1KnA@mail.gmail.comReviewed-by: Erik RijkersBackpatch-through: 11
1 parent0cc46c8 commitb70db6c

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

‎doc/src/sgml/ddl.sgml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4055,12 +4055,13 @@ ALTER INDEX measurement_city_id_logdate_key
40554055
<itemizedlist>
40564056
<listitem>
40574057
<para>
4058-
Unique constraints (and hence primary keys) on partitioned tables must
4059-
include all the partition key columns. This limitation exists because
4060-
the individual indexes making up the constraint can only directly
4061-
enforce uniqueness within their own partitions; therefore, the
4062-
partition structure itself must guarantee that there are not
4063-
duplicates in different partitions.
4058+
To create a unique or primary key constraint on a partitioned table,
4059+
the partition keys must not include any expressions or function calls
4060+
and the constraint's columns must include all of the partition key
4061+
columns. This limitation exists because the individual indexes making
4062+
up the constraint can only directly enforce uniqueness within their own
4063+
partitions; therefore, the partition structure itself must guarantee
4064+
that there are not duplicates in different partitions.
40644065
</para>
40654066
</listitem>
40664067

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp