Search Postgresql Archives

Re: Thoughts on a cosntraint ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Sep 29, 2019 at 12:40 PM stan <stanb@xxxxxxxxx> 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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux