Re: Constraint Problem

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Constraint Problem
Дата
Msg-id 15394.1067795295@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Constraint Problem  (Ron St-Pierre <rstpierre@syscor.com>)
Ответы Re: Constraint Problem  (Ron St-Pierre <rstpierre@syscor.com>)
Re: Constraint Problem  (Ron St-Pierre <rstpierre@syscor.com>)
Список pgsql-general
Ron St-Pierre <rstpierre@syscor.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

В списке pgsql-general по дате отправления:

Предыдущее
От: Ron St-Pierre
Дата:
Сообщение: Constraint Problem
Следующее
От: Ryan Mack
Дата:
Сообщение: PostgreSQL License Question