Re: Postgres 11: Table Partitioning and Primary Keys
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: "David G. Johnston" <david.g.johnston@gmail.com>
Cc: Bruce Momjian <bruce@momjian.us>, phil.bayer@gmail.com, pgsql-docs@lists.postgresql.org, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2019-07-09T06:34:48Z
Lists: pgsql-hackers, pgsql-docs
On Mon, Jul 08, 2019 at 08:12:18PM -0700, David G. Johnston wrote: > Reads a bit backward. How about: > > "As uniqueness can only be enforced within an individual partition when > defining a primary key on a partitioned table all columns present in the > partition key must also exist in the primary key." Yes, I was not really inspired on this one. Looking closely at the code in DefineIndex() (and as Rajkumar has mentioned upthread for unique constraints) this can happen for primary keys, unique constraints and exclusion constraints. So we had better mention all three of them. I am not sure that we need to be explicit about the uniqueness part though, let's say the following: "When defining a primary key, a unique constraint or an exclusion constraint on a partitioned table, all the columns present in the constraint definition must be included in the partition key." -- Michael
Commits
-
Mention limitation of unique in partitioned tables
- 5918b8261451 11.5 landed
- ec4eaab78b07 13.0 landed
- 220857a87508 12.0 landed