Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-novice by date

Next:From: joseph speigleDate: 2004-02-01 09:40:56
Subject: Re: Constrain duplicate patterns
Previous:From: Russell ShawDate: 2004-02-01 09:11:50
Subject: Re: Constrain duplicate patterns

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group