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

Re: Ignore unique violations?

From: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: Ignore unique violations?
Date: 2008-03-27 09:52:20
Message-ID: 20080327095220.GE26764@a-kretschmer.de (view raw or flat)
Thread:
Lists: pgsql-novice
am  Thu, dem 27.03.2008, um  9:45:33 +0000 mailte A B folgendes:
> Is there any easy way of ignoring unique violations?
> I have a table (a integer, b integer, unique (a,b) ) and want to
> insert pairs of values for a and b, but I do not want to first select
> to see if there is a pair  before inserting.
> So can I make postgres ignore any error or exception?

I hope this link can help you:
http://andreas.scherbaum.la/blog/archives/11-Avoid-Unique-Key-violation.html


Regards, Andreas
-- 
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   http://wwwkeys.de.pgp.net

In response to

Responses

pgsql-novice by date

Next:From: Emil ObermayrDate: 2008-03-27 10:06:24
Subject: Re: Reuse serial numbers?
Previous:From: A. KretschmerDate: 2008-03-27 09:49:06
Subject: Re: Reuse serial numbers?

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