Re: Constraint Problem - Mailing list pgsql-general

From Martin Marques
Subject Re: Constraint Problem
Date
Msg-id 200311031726.41002.martin@bugs.unl.edu.ar
Whole thread Raw
In response to Re: Constraint Problem  ("scott.marlowe" <scott.marlowe@ihs.com>)
List pgsql-general
El Lun 03 Nov 2003 17:00, scott.marlowe escribió:
> >
> > This is not quite what I need. I need to create a constraint to allow
> > only -one- of
> >     company<->association<->default(=true) value
> > but any number of
> >     company<->association<->default(=false) values
> >
> > I've tried many different ALTER TABLE ... CREATE CONSTRAINT variations,
> > all without success.
>
> Wouldn't a unique constraint on those three fields do this?  Nulls don't
> violate unique constraints.  Does that work, or did I miss too much of
> this conversation?

Scott, he want's to have as much falses as can be in the association field,
but only one true.

--
El mejor sistema operativo es aquel que te da de comer.
Cuida tu dieta.
-----------------------------------------------------------------
Martin Marques                  |        mmarques@unl.edu.ar
Programador, Administrador      |       Centro de Telematica
                       Universidad Nacional
                            del Litoral
-----------------------------------------------------------------


pgsql-general by date:

Previous
From: Greg Stark
Date:
Subject: Re: Cartesian product bug?
Next
From: Peter Eisentraut
Date:
Subject: Re: C functions quicker than Plpgsql?