Re: Constraint Problem

From: Martin Marques <martin(at)bugs(dot)unl(dot)edu(dot)ar>
To: "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com>, Ron St-Pierre <rstpierre(at)syscor(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Constraint Problem
Date: 2003-11-03 20:26:40
Message-ID: 200311031726.41002.martin@bugs.unl.edu.ar
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)unl(dot)edu(dot)ar
Programador, Administrador | Centro de Telematica
Universidad Nacional
del Litoral
-----------------------------------------------------------------

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Peter Eisentraut 2003-11-03 20:38:58 Re: C functions quicker than Plpgsql?
Previous Message Greg Stark 2003-11-03 20:21:58 Re: Cartesian product bug?