pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Amit Langote <amitlangote09@gmail.com>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: 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, 09 Jul 2019 18:59:59 -0400
Message-ID: <1341.1562713199@sss.pgh.pa.us> (raw)
In-Reply-To: <20190709225333.GA18051@alvherre.pgsql>
References: <20190709225333.GA18051@alvherre.pgsql>

Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> That's a mild personal preference only though.  Anyway, based on your
> proposed wording, I wrote this:

>      <listitem>
>       <para>
>        Unique constraints on partitioned tables (as well as primary keys)
>        must constrain all the partition key columns.  This limitation exists
>        because <productname>PostgreSQL</productname> can only enforce
>        uniqueness in each partition individually.
>       </para>
>      </listitem>

> I'm not really sure about the "must constrain" verbiage.  Is that really
> comprehensible?

I think "must include" might be better.

> In CREATE TABLE, we already have this:
>      <para>
>       When establishing a unique constraint for a multi-level partition
>       hierarchy, all the columns in the partition key of the target
>       partitioned table, as well as those of all its descendant partitioned
>       tables, must be included in the constraint definition.
>      </para>

> which may not be the pinnacle of clarity, but took some time to craft
> and I think is correct.  Also it doesn't mention primary keys
> explicitly; maybe we should patch it by adding "(as well as a primary
> key)" right after "a unique constraint".  Thoughts?

I'd leave that alone.  I don't think the parenthetical comment about
primary keys in your new text is adding much either.

			regards, tom lane





view thread (15+ messages)  latest in thread

Message-ID: <1341.1562713199@sss.pgh.pa.us>
Permalink:  ../1341.1562713199@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1341.1562713199@sss.pgh.pa.us

 · 

reply

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: tgl@sss.pgh.pa.us, alvherre@2ndquadrant.com, amitlangote09@gmail.com, 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: <1341.1562713199@sss.pgh.pa.us>

* 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