Re: Constrain duplicate patterns

From: Michael Glaesemann <grzm(at)myrealbox(dot)com>
To: Russell Shaw <rjshaw(at)iprimus(dot)com(dot)au>
Cc: 'pgsql-novice(at)postgresql(dot)org' <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Constrain duplicate patterns
Date: 2004-02-01 09:21:54
Message-ID: 13B30164-5498-11D8-AB38-000A95C88220@myrealbox.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice


On Feb 1, 2004, at 6:06 PM, Russell Shaw wrote:

> Hi,
>
> Is there a way to make postgresql report an error if when
> inserting data, a multiple-column combination is duplicated?

I believe you're looking for UNIQUE(part_id, vendor_id), if you want to
prevent this from happening. If you just want it to report an error,
but allow the insert/update anyway, maybe a trigger? Not sure about
that though.

Hope this helps.

Michael Glaesemann
grzm myrealbox com

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message joseph speigle 2004-02-01 09:40:56 Re: Constrain duplicate patterns
Previous Message Russell Shaw 2004-02-01 09:11:50 Re: Constrain duplicate patterns