Ignore unique violations?

From: "A B" <gentosaker(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Ignore unique violations?
Date: 2008-03-27 09:45:33
Message-ID: dbbf25900803270245k439841bdq45f14dffa340c1a3@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

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?

The inserts are placed inside of a transaction and I really don't want
any silly error to abort it.

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message A. Kretschmer 2008-03-27 09:49:06 Re: Reuse serial numbers?
Previous Message A B 2008-03-27 09:36:57 Reuse serial numbers?