Re: Constraint Problem
От
Ron St-Pierre
Тема
Re: Constraint Problem
Дата
Msg-id
3FA69FEA.2070405@syscor.com
Ответ на
Re: Constraint Problem (Tom Lane)
Список
Дерево обсуждения
Constraint Problem Ron St-Pierre <rstpierre@syscor.com>
Re: Constraint Problem Tom Lane <tgl@sss.pgh.pa.us>
Re: Constraint Problem Ron St-Pierre <rstpierre@syscor.com>
Re: Constraint Problem Ron St-Pierre <rstpierre@syscor.com>
Re: Constraint Problem Greg Stark <gsstark@mit.edu>
Re: Constraint Problem Ron St-Pierre <rstpierre@syscor.com>
Re: Constraint Problem Csaba Nagy <nagy@ecircle-ag.com>
Re: Constraint Problem Stephan Szabo <sszabo@megazone.bigpanda.com>
Re: Constraint Problem Ron St-Pierre <rstpierre@syscor.com>
Re: Constraint Problem Alvaro Herrera <alvherre@dcc.uchile.cl>
Re: Constraint Problem Jan Wieck <JanWieck@Yahoo.com>
Re: Constraint Problem Greg Stark <gsstark@mit.edu>
Re: Constraint Problem Ron St-Pierre <rstpierre@syscor.com>
Re: Constraint Problem Greg Stark <gsstark@mit.edu>
Re: Constraint Problem Greg Stark <gsstark@mit.edu>
Re: Constraint Problem "scott.marlowe" <scott.marlowe@ihs.com>
Re: Constraint Problem Martin Marques <martin@bugs.unl.edu.ar>
Tom Lane wrote:
>Ron St-Pierre 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
>
>
>
>
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.
Anyone know how?
Thanks
Ron
В списке pgsql-general по дате отправления