From: Michael Paquier <michael@paquier.xyz>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: Bruce Momjian <bruce@momjian.us>
Cc: phil.bayer@gmail.com, pgsql-docs@lists.postgresql.org, PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: Postgres 11: Table Partitioning and Primary Keys
Date: Tue, 9 Jul 2019 15:34:48 +0900
Message-ID: <20190709063448.GB23827@paquier.xyz> (raw)
In-Reply-To: <CAKFQuwZfzNGTTo4zVn0Q=wfXujfaKdFbn7v5eAp20Eud7r95cA@mail.gmail.com>
References: <156236160709.1192.4498528196556144085@wrigleys.postgresql.org>
<20190709023737.vhrd4pxe4hgnd3ks@momjian.us>
<20190709025856.GC1345@paquier.xyz>
<CAKFQuwZfzNGTTo4zVn0Q=wfXujfaKdFbn7v5eAp20Eud7r95cA@mail.gmail.com>
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
Attachments:
[application/pgp-signature] signature.asc (832B, ../20190709063448.GB23827@paquier.xyz/2-signature.asc)
download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-docs@postgresql.org
Cc: michael@paquier.xyz, david.g.johnston@gmail.com, bruce@momjian.us, pgsql-hackers@postgresql.org
Subject: Re: Postgres 11: Table Partitioning and Primary Keys
In-Reply-To: <20190709063448.GB23827@paquier.xyz>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox