Re: Question on creating keys on partitioned tables

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Siddharth Jain <siddhsql(at)gmail(dot)com>
Cc: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Question on creating keys on partitioned tables
Date: 2023-03-31 16:06:59
Message-ID: 560122.1680278819@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Siddharth Jain <siddhsql(at)gmail(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Siddharth Jain 2023-03-31 17:35:21 Re: Question on creating keys on partitioned tables
Previous Message Paul Ramsey 2023-03-31 15:57:25 Re: Cannot terminate backend