Re: ERROR: insufficient columns in the PRIMARY KEY constraint definition
David Rowley <dgrowleyml@gmail.com>
From: David Rowley <dgrowleyml@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>,
Nagaraj Raj <nagaraj.sf@yahoo.com>, Pg Bugs <pgsql-bugs@postgresql.org>
Date: 2020-09-29T23:13:56Z
Lists: pgsql-bugs
Attachments
- document_that_pks_must_be_a_superset_of_partition_constraint.patch (application/octet-stream) patch
On Wed, 30 Sep 2020 at 12:08, David Rowley <dgrowleyml@gmail.com> wrote: > > On Wed, 30 Sep 2020 at 11:43, Tom Lane <tgl@sss.pgh.pa.us> wrote: > > > > Alvaro Herrera <alvherre@2ndquadrant.com> writes: > > > "Unique constraints (and[, by extension,] primary key constraints) on > > > partitioned tables must include all the partition key columns. This > > > limitation exists because PostgreSQL can only enforce uniqueness in each > > > partition individually.". > > > > I don't object to clarifying that (and that wording seems fine), but I > > think fixing the error message is more important. We'd not be having this > > discussion if the OP had found that documentation. > > I do agree the error message is the first thing we should be changing. > > I'll write a doc patch if you handle the error message. I didn't go with the same wording. The reason was that I didn't feel the word "constraint" had to be mentioned twice. I won't object if you or Alvaro want to keep Alvaro's suggestion though. David
Commits
-
Reword partitioning error message
- f669ba7bdb00 12.5 landed
- 9fc212271289 14.0 landed
- 5b76e8fb675e 11.10 landed
- 49433744ff65 13.1 landed
-
Doc: Improve clarity on partitioned table limitations
- ab0c9c073563 11.10 landed
- 5c7afb4a29aa 12.5 landed
- 5610ffaf00a5 13.1 landed
- 2b888647d864 14.0 landed