Re: Trigger function aborts the transaction on exception - Mailing list pgsql-jdbc

From Kris Jurka
Subject Re: Trigger function aborts the transaction on exception
Date
Msg-id Pine.LNX.4.33.0401310335330.17634-100000@leary.csoft.net
Whole thread Raw
In response to Trigger function aborts the transaction on exception  ("Rajat Katyal" <rajatk@intelesoftech.com>)
List pgsql-jdbc

On Sat, 31 Jan 2004, Rajat Katyal wrote:

> Hi: I came to know from the postgresql documentation that PostgreSQL
> does not have a very smart exception handling model. I wonder whether
> anyone can help me or suggest some alternate solution for the problem
> stated below:
>
> I have a trigger function defined for the insert and iam executing sql
> statement as:
>
> insert into target_table select * from source_table;
>
> Now there could be scenario that in some record error occured due to
> the type cast therefore i want to catch the execption and want to make
> it entry in some other table but my process of insertion for the other
> records should go on as they have valid records. But it throws the
> exception and aborts the transaction.
>

This list is for JDBC related questions.  Your question is more
appropriate for pgsql-general@postgresql.org.   That said, with a BEFORE
INSERT trigger you may return NULL instead of NEW to indicate that the row
should not be inserted.

Kris Jurka


pgsql-jdbc by date:

Previous
From: "John Green"
Date:
Subject: Config on Netbeans for OS X Panther
Next
From: snpe
Date:
Subject: Re: Config on Netbeans for OS X Panther