Re: Thoughts on a cosntraint ?

From: John W Higgins <wishdev(at)gmail(dot)com>
To: pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Thoughts on a cosntraint ?
Date: 2019-09-29 19:52:50
Message-ID: CAPhAwGz17hBnKdnMoZZAx=9Edkn5ih2rzJFEhQhGx+vopnWrCQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sun, Sep 29, 2019 at 12:40 PM stan <stanb(at)panix(dot)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

>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Rob Sargent 2019-09-29 20:41:57 Re: Thoughts on a cosntraint ?
Previous Message stan 2019-09-29 19:40:20 Thoughts on a cosntraint ?