Re: Constraint Problem

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ron St-Pierre <rstpierre(at)syscor(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Constraint Problem
Date: 2003-11-02 17:48:15
Message-ID: 15394.1067795295@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Marc G. Fournier 2003-11-02 20:59:48 Re: PostgreSQL License Question
Previous Message Will Trillich 2003-11-02 17:18:56 Re: Perl and Postgres