Re: Thoughts on a cosntraint ?

Поиск
Список
Период
Сортировка
От John W Higgins
Тема Re: Thoughts on a cosntraint ?
Дата
Msg-id CAPhAwGz17hBnKdnMoZZAx=9Edkn5ih2rzJFEhQhGx+vopnWrCQ@mail.gmail.com
обсуждение исходный текст
Ответ на Thoughts on a cosntraint ?  (stan <stanb@panix.com>)
Ответы Re: Thoughts on a cosntraint ?
Список pgsql-general
On Sun, Sep 29, 2019 at 12:40 PM stan <stanb@panix.com> wrote:
I have a table that consists of 3 columns.

vendor_key
mfg_key
preferred (boolean)

The idea is that a given vendor is the vendor we want to use for each
manufacturer for a given project.

I need to constrain such that  only on row of mfg, vendor and project can
be set to TRUE.


Partial unique index

Example 3 on this page https://www.postgresql.org/docs/current/indexes-partial.html is exactly what you are looking for.

John W Higgins

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

Предыдущее
От: stan
Дата:
Сообщение: Thoughts on a cosntraint ?
Следующее
От: Rob Sargent
Дата:
Сообщение: Re: Thoughts on a cosntraint ?