Re: (9.1) btree_gist support for searching on "not equals"

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: Marko Tiikkaja <marko(dot)tiikkaja(at)cs(dot)helsinki(dot)fi>
Cc: pgsql-hackers(at)postgresql(dot)org, Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>, Teodor Sigaev <teodor(at)sigaev(dot)ru>
Subject: Re: (9.1) btree_gist support for searching on "not equals"
Date: 2010-05-25 03:25:18
Message-ID: 1274757918.3342.4.camel@jdavis
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2010-05-25 03:25:58 Re: ExecutorCheckPerms() hook
Previous Message Robert Haas 2010-05-25 03:23:41 Re: pg_upgrade docs