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: (view raw, whole thread or download thread mbox)
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


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-2017 The PostgreSQL Global Development Group