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

Ignoring an SQL INSERT error

From: Shawn Chisholm <ShawnC(at)sandvine(dot)com>
To: "'pgsql-novice(at)postgresql(dot)org'" <pgsql-novice(at)postgresql(dot)org>
Subject: Ignoring an SQL INSERT error
Date: 2004-06-07 17:54:37
Message-ID: FE045D4D9F7AED4CBFF1B3B813C8533702C76E87@mail.sandvine.com (view raw or flat)
Thread:
Lists: pgsql-novice
Hi,

Does anyone know of a way to perform an insert that does not abort the
transaction if it fails?  

I am trying to implement a rule that will allow the insertion data into a
view (for backward compatability) by performing inserts in other tables, and
there are situations where an insert into one of the underlying tables is
unnecessary and causes a unique key constraint violation.  Ideally I would
like to do an insert and ignore any errors...

Thanks,

Shawn

PS. I am using PostgreSql 7.4



Responses

pgsql-novice by date

Next:From: Scott MarloweDate: 2004-06-07 19:57:16
Subject: Re: Shut down postgres server...
Previous:From: celoftisDate: 2004-06-07 00:58:16
Subject: Shut down postgres server...

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