Re: Constraint Problem

From: Ron St-Pierre <rstpierre(at)syscor(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Constraint Problem
Date: 2003-11-03 02:46:19
Message-ID: 3FA5C17B.6000205@syscor.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tom Lane wrote:
> Ron St-Pierre <rstpierre(at)syscor(dot)com> writes:
>
>>I just want to constrain the ysnDefault field to only allow one TRUE
>>value for any companyID/associationID pair, with no restrictions on the
>>number of FALSES.
>
>
> You could do that with a partial unique index. There is an example
> at the bottom of
> http://www.postgresql.org/docs/7.3/static/indexes-partial.html
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faqs/FAQ.html
>

Thanks Tom. That's exactly what I need.

Ron

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2003-11-03 03:12:11 Re: slow query performance
Previous Message Joe Conway 2003-11-03 02:33:21 Re: Custom types and arrays