Re: (9.1) btree_gist support for searching on "not equals" - Mailing list pgsql-hackers

From Jeff Davis
Subject Re: (9.1) btree_gist support for searching on "not equals"
Date
Msg-id 1274757918.3342.4.camel@jdavis
Whole thread Raw
In response to Re: (9.1) btree_gist support for searching on "not equals"  (Marko Tiikkaja <marko.tiikkaja@cs.helsinki.fi>)
Responses Re: (9.1) btree_gist support for searching on "not equals"
List pgsql-hackers
On Sat, 2010-05-22 at 01:02 +0300, Marko Tiikkaja wrote:
> On 5/21/10 11:47 PM +0300, Jeff Davis wrote:
> > It also allows you to enforce the constraint that only one tuple exists
> > in a table by doing something like:
> >
> >    create table a
> >    (
> >      i int,
> >      exclude using gist (i with<>),
> >      unique (i)
> >    );
> 
> FWIW, this is achievable a lot more easily:
> CREATE UNIQUE INDEX "a_single_row" ON a ((1));
> 

Yes, you're right. Also, neither of us accounted for NULLs, so I suppose
a NOT NULL is necessary as well.

I think the original case (same values only) is potentially useful
enough that we should support it.

Regards,Jeff Davis



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: ExecutorCheckPerms() hook
Next
From: Bruce Momjian
Date:
Subject: Re: pg_upgrade docs