Re: Unique constraints for non-btree indexes

From: Greg Stark <gsstark(at)mit(dot)edu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Martijn van Oosterhout <kleptog(at)svana(dot)org>, "Jonah H(dot) Harris" <jonah(dot)harris(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Unique constraints for non-btree indexes
Date: 2006-01-19 06:44:54
Message-ID: 87hd80wwbd.fsf@stark.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:

> Martijn van Oosterhout <kleptog(at)svana(dot)org> writes:
> > I guess what you're talking about is a constrained index, of which a
> > unique index is just a particular type. I suppose the actual constraint
> > would be one of the operators defined for the operator class (since
> > whatever the test is, it needs to be indexable). Although some would
> > obviously be more useful than others...
>
> I think the generalization that would be appropriate for GIST is that
> a "unique" index guarantees there are no two entries x, y such that
> x ~ y, where ~ is some boolean operator nominated by the opclass. We'd
> probably have to insist that ~ is commutative (x ~ y iff y ~ x).

I have no big contribution here. I just want to say this is a cool idea.
These Generalized uniqueish constraints could make a lot of neat things
possible.

--
greg

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2006-01-19 06:45:58 Indexes vs. cache flushes
Previous Message Joshua D. Drake 2006-01-19 06:34:42 8.0.5 Bug in unique indexes?