Re: Constrain duplicate patterns - Mailing list pgsql-novice

From Russell Shaw
Subject Re: Constrain duplicate patterns
Date
Msg-id 401CC2D6.5000009@iprimus.com.au
Whole thread Raw
In response to Constrain duplicate patterns  (Russell Shaw <rjshaw@iprimus.com.au>)
Responses Re: Constrain duplicate patterns  (joseph speigle <joe.speigle@jklh.us>)
List pgsql-novice
Russell Shaw wrote:
> Hi,
>
> Is there a way to make postgresql report an error if when
> inserting data, a multiple-column combination is duplicated?
>
> CREATE TABLE parts_vendors (
>     part_id integer references parts (part_id),
>     vendor_id integer references vendors (vendor_id),
>     ...
> )
>
> part_id  vendor_id
> ------------------
> 1        3
> 2        5 <--+
> 7        9    |
> 2        5 <--+-- duplicate pattern
> ...
>

Oops, i can just do a select on the various columns
to detect this...

pgsql-novice by date:

Previous
From: Russell Shaw
Date:
Subject: Constrain duplicate patterns
Next
From: Michael Glaesemann
Date:
Subject: Re: Constrain duplicate patterns