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

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...



PS. I am using PostgreSql 7.4


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