Re: Patch: Global Unique Index

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Vik Fearing <vik(at)postgresfriends(dot)org>, Cary Huang <cary(dot)huang(at)highgo(dot)ca>, Thomas Kellerer <shammat(at)gmx(dot)net>
Cc: pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Patch: Global Unique Index
Date: 2022-11-30 12:28:50
Message-ID: 0086c87f900172e4103a4563e7ffc05856e21412.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, 2022-11-30 at 10:09 +0100, Vik Fearing wrote:
> On 11/29/22 17:29, Laurenz Albe wrote:
> > On Tue, 2022-11-29 at 13:58 +0100, Vik Fearing wrote:
> > > I disagree.  A user does not need to know that a table is partitionned,
> > > and if the user wants a unique constraint on the table then making them
> > > type an extra word to get it is just annoying.
> >
> > Hmm.  But if I created a primary key without thinking too hard about it,
> > only to discover later that dropping old partitions has become a problem,
> > I would not be too happy either.
>
> I have not looked at this patch, but my understanding of its design is
> the "global" part of the index just makes sure to check a unique index
> on each partition.  I don't see from that how dropping old partitions
> would be a problem.

Right, I should have looked closer. But, according to the parallel discussion,
ATTACH PARTITION might be a problem. A global index is likely to be a footgun
one way or the other, so I think it should at least have a safety on
(CREATE PARTITIONED GLOBAL INDEX or something).

Yours,
Laurenz Albe

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Ian Lawrence Barwick 2022-11-30 12:38:12 Re: Atomic rename feature for Windows.
Previous Message Bharath Rupireddy 2022-11-30 11:57:10 Re: O(n) tasks cause lengthy startups and checkpoints