pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ron <ronljohnsonjr@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: On partitioning, PKs and FKs
Date: Thu, 8 Jul 2021 15:09:56 -0500
Message-ID: <03b166e9-ef78-ee62-3e5f-27a45fa7debb@gmail.com> (raw)
In-Reply-To: <b8c68130-8fcc-3833-0c35-3ec3cf5efcf1@apollotyres.com>
References: <CAD1W9HW+u8uouPfV9=UED4-TyXGL_3ffbhMU53iPUUGkpg9ETA@mail.gmail.com>
	<9cb3fdc8-8732-8db6-5342-bbde540872ea@gmail.com>
	<b8c68130-8fcc-3833-0c35-3ec3cf5efcf1@apollotyres.com>

The docs are pretty clear that all constraints must have the partition key 
as part of the key, and PK is most certainly a constraint.

I welcome a counter-example.

On 7/8/21 10:23 AM, Alban Hertroys wrote:
> On 2021-07-08 13:30, Ron wrote:
> > Thus, the bigTable PK must be on id, columnX, (No, I don't like it
> > either.)
>
> That's not entirely true. You can keep the PK on id if you additionally
> create a unique constraint on (id, columnX).
>
> That way, you can at least be certain that the uniqueness of the PK
> remains in-tact, even if that is a surrogate key that has nothing to do
> with the uniqueness of the actual records.
>
> Regards,
>
> Alban Hertroys.
>
>
> *Alban Hertroys***
>
> 		
>
> Apollo Tyres (NL) B.V.
> Ir. E.L.C. Schiffstraat 370, 7547 RD Enschede, The Netherlands
> +31 (0)53 4888 776
>
> alban.hertroys@apollotyres.com
> Chamber of Commerce number: 34223268
>
> CIN: L25111KL1972PLC002449
>
> Registered Office: Apollo Tyres Ltd, 3rd Floor, Areekal Mansion, Panampilly Nagar, Kochi  682036, India
>
>
>
> Disclaimer:
>
> The information contained in this e-mail is intended solely for the use of the individual or entity to whom it is addressed. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or action in relation to the contents of this information is strictly prohibited and may be unlawful and request you to delete this message and any attachments and advise the sender by return e-mail. The confidentiality of this message is not warranted. Apollo Tyres and its subsidiaries rule out any and every liability resulting from this or any other electronic transmiss
>

-- 
Angular momentum makes the world go 'round.

view thread (8+ messages)  latest in thread

Message-ID: <03b166e9-ef78-ee62-3e5f-27a45fa7debb@gmail.com>
Permalink:  ../03b166e9-ef78-ee62-3e5f-27a45fa7debb@gmail.com/
Also on:    postgresql.org/message-id/03b166e9-ef78-ee62-3e5f-27a45fa7debb@gmail.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: ronljohnsonjr@gmail.com
  Subject: Re: On partitioning, PKs and FKs
  In-Reply-To: <03b166e9-ef78-ee62-3e5f-27a45fa7debb@gmail.com>
  References: <CAD1W9HW+u8uouPfV9=UED4-TyXGL_3ffbhMU53iPUUGkpg9ETA@mail.gmail.com> <9cb3fdc8-8732-8db6-5342-bbde540872ea@gmail.com> <b8c68130-8fcc-3833-0c35-3ec3cf5efcf1@apollotyres.com> <03b166e9-ef78-ee62-3e5f-27a45fa7debb@gmail.com>

* 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