public inbox for [email protected]
help / color / mirror / Atom feedFrom: Tom Lane <[email protected]>
To: Ron Johnson <[email protected]>
Cc: pgsql-general <[email protected]>
Subject: Re: Regarding use of single column as primary key on partitioned table
Date: Sat, 28 Sep 2024 00:55:06 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <CANzqJaAknAV3vhxQ3tnJkGbHEmQJwWhi5jVW7wYkwZx4WQh2DA@mail.gmail.com>
References: <CAJCZko+pA8o3HDBuGzxzYjMo=Gm_8yBLk7Sod3Fdo-i0WAwLuA@mail.gmail.com>
<CAKFQuwarcToEtVZHOo5O_CBe4ZD2mGZM35R28kLn=MNi0D6X2w@mail.gmail.com>
<CANzqJaAknAV3vhxQ3tnJkGbHEmQJwWhi5jVW7wYkwZx4WQh2DA@mail.gmail.com>
Ron Johnson <[email protected]> writes:
> On Sat, Sep 28, 2024 at 12:39 AM David G. Johnston <
> [email protected]> wrote:
>> On Friday, September 27, 2024, Durgamahesh Manne <
>>> 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.
You can call it a flaw if you want, but it's an intentional design
limitation. The only way to relax it would be to invent global
indexes (that is, single indexes covering the entire partitioning
tree), which would basically throw away every advantage of making
a partitioned structure in the first place. If that's what you
want, don't partition your table.
regards, tom lane
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], [email protected]
Subject: Re: Regarding use of single column as primary key on partitioned table
In-Reply-To: <[email protected]>
* 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