public inbox for [email protected]  
help / color / mirror / Atom feed
From: Ron Johnson <[email protected]>
To: pgsql-general <[email protected]>
Subject: Re: Regarding use of single column as primary key on partitioned table
Date: Sat, 28 Sep 2024 00:49:35 -0400
Message-ID: <CANzqJaAknAV3vhxQ3tnJkGbHEmQJwWhi5jVW7wYkwZx4WQh2DA@mail.gmail.com> (raw)
In-Reply-To: <CAKFQuwarcToEtVZHOo5O_CBe4ZD2mGZM35R28kLn=MNi0D6X2w@mail.gmail.com>
References: <CAJCZko+pA8o3HDBuGzxzYjMo=Gm_8yBLk7Sod3Fdo-i0WAwLuA@mail.gmail.com>
	<CAKFQuwarcToEtVZHOo5O_CBe4ZD2mGZM35R28kLn=MNi0D6X2w@mail.gmail.com>

On Sat, Sep 28, 2024 at 12:39 AM David G. Johnston <
[email protected]> wrote:

> On Friday, September 27, 2024, Durgamahesh Manne <
> [email protected]> wrote:
>
>>
>> ERROR:  unique constraint on partitioned table must include all
>> partitioning columns
>> DETAIL:  PRIMARY KEY constraint on table "bet" lacks column "placedon"
>> which is part of the partition key.
>> test=>
>>
>> Can't we use primary key on singal column(betid) on partitioned table
>> rather than using composite key (placedon,betid)?
>>
>
> No.  It would be misleading to allow such a thing because a unique index
> can only span a single partition.
>

That is IMO a serious (and probably unfixable, given how PG stores tables)
flaw in PG's partitioning design.

-- 
Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> crustacean!


view thread (3+ messages)  latest in thread

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: [email protected]
  Cc: [email protected]
  Subject: Re: Regarding use of single column as primary key on partitioned table
  In-Reply-To: <CANzqJaAknAV3vhxQ3tnJkGbHEmQJwWhi5jVW7wYkwZx4WQh2DA@mail.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 agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox