Re: ERROR: insufficient columns in the PRIMARY KEY constraint definition

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Nagaraj Raj <nagaraj(dot)sf(at)yahoo(dot)com>, Pg Bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: ERROR: insufficient columns in the PRIMARY KEY constraint definition
Date: 2020-09-29 23:13:56
Message-ID: CAApHDvpE5omXqenT5wFLHigbJFjixqUC-DkcTw6aCFoMLmU2jw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Wed, 30 Sep 2020 at 12:08, David Rowley <dgrowleyml(at)gmail(dot)com> wrote:
>
> On Wed, 30 Sep 2020 at 11:43, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> >
> > Alvaro Herrera <alvherre(at)2ndquadrant(dot)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

Attachment Content-Type Size
document_that_pks_must_be_a_superset_of_partition_constraint.patch application/octet-stream 661 bytes

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2020-09-29 23:21:30 Re: ERROR: insufficient columns in the PRIMARY KEY constraint definition
Previous Message David Rowley 2020-09-29 23:08:43 Re: ERROR: insufficient columns in the PRIMARY KEY constraint definition