Re: UNIQUE boolean: only one row may be "true"

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Randall Lucas <rlucas(at)tercent(dot)net>
Cc: Michael Teter <michael_teter(at)yahoo(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: UNIQUE boolean: only one row may be "true"
Date: 2003-05-07 03:00:51
Message-ID: 24135.1052276451@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Randall Lucas <rlucas(at)tercent(dot)net> writes:
> Do you have any suggestions on how this might
> better be implemented? It seems to me that with a partial index, there
> is not too much overhead and it doesn't seem too offensively
> un-boycecoddean.

FWIW, I'd go with the unique partial index too. It's a very efficient
solution. But it's not portable :-(. I'd be interested to hear what
people would do to solve this problem in bog-standard SQL.

regards, tom lane

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2003-05-07 04:46:59 Re: "deadlock detected" documentation
Previous Message Matt Mello 2003-05-06 21:48:17 "deadlock detected" documentation