pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Siddharth Jain <siddhsql@gmail.com>
Cc: Laurenz Albe <laurenz.albe@cybertec.at>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Question on creating keys on partitioned tables
Date: Fri, 31 Mar 2023 12:06:59 -0400
Message-ID: <560122.1680278819@sss.pgh.pa.us> (raw)
In-Reply-To: <CAPqV3pTuTV6qPpvWT8f67yd8EPP79vk2Ww5ddJkwmEdWCCQdXA@mail.gmail.com>
References: <CAPqV3pTAUwjpGpg_=88GR9t8Zd4boUO8acqY4To1pzZFuBiSVQ@mail.gmail.com>
	<d0379fb1269069f2fc7823fb2414cf03b215fdaa.camel@cybertec.at>
	<CAPqV3pTuTV6qPpvWT8f67yd8EPP79vk2Ww5ddJkwmEdWCCQdXA@mail.gmail.com>

Siddharth Jain <siddhsql@gmail.com> writes:
> I think the two are equivalent. If not, could you please explain why?

Well, they're formally equivalent if you require there to be only one
X value per partition (ie, PARTITION BY LIST with only one listed value
per partition); if there's more, they're not the same thing.

Neither one guarantees that Y is globally unique.  We have no mechanism
for enforcing uniqueness across partitions except for partition key
columns.

			regards, tom lane





view thread (6+ messages)  latest in thread

Message-ID: <560122.1680278819@sss.pgh.pa.us>
Permalink:  ../560122.1680278819@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/560122.1680278819@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 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: tgl@sss.pgh.pa.us, siddhsql@gmail.com, laurenz.albe@cybertec.at
  Subject: Re: Question on creating keys on partitioned tables
  In-Reply-To: <560122.1680278819@sss.pgh.pa.us>
  References: <CAPqV3pTAUwjpGpg_=88GR9t8Zd4boUO8acqY4To1pzZFuBiSVQ@mail.gmail.com> <d0379fb1269069f2fc7823fb2414cf03b215fdaa.camel@cybertec.at> <CAPqV3pTuTV6qPpvWT8f67yd8EPP79vk2Ww5ddJkwmEdWCCQdXA@mail.gmail.com> <560122.1680278819@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