Re: Unique Index

From: Greg Stark <gsstark(at)mit(dot)edu>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Unique Index
Date: 2005-01-20 18:02:26
Message-ID: 87hdlcc72l.fsf@stark.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Frank D. Engel, Jr." <fde101(at)fjrhome(dot)net> writes:

> I'm sure this won't work for some reason, but something similar might; why not
> create a unique index on a constant where all three are null; something along
> these lines (in addition to the others):
>
> CREATE UNIQUE INDEX foo_trio_index ON foo (1) WHERE c IS NULL AND a IS NULL and
> b IS NULL;
>

Huh. Hadn't thought of creating an index on a constant. It works if you put an
extra set of parentheses in:

CREATE UNIQUE INDEX foo_abc_index ON foo ((1)) WHERE ...

--
greg

In response to

Browse pgsql-general by date

  From Date Subject
Next Message troyston campano 2005-01-20 18:12:48 Postgresql Security Pen Test
Previous Message Jackson Pauls 2005-01-20 17:42:43 Re: connecting with a 8.0.0 client with ssl