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

Trigger function aborts the transaction on exception

From: "Rajat Katyal" <rajatk(at)intelesoftech(dot)com>
To: <pgsql-jdbc(at)postgresql(dot)org>
Subject: Trigger function aborts the transaction on exception
Date: 2004-01-31 04:45:38
Message-ID: 000801c3e7b5$1384e840$2105a8c0@coffee (view raw or flat)
Thread:
Lists: pgsql-jdbc
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.

Please help me and suggest some solution for this problem.

Thanks in advance.

Rajat.

Responses

pgsql-jdbc by date

Next:From: Kris JurkaDate: 2004-01-31 08:37:35
Subject: Re: Trigger function aborts the transaction on exception
Previous:From: John GreenDate: 2004-01-31 03:21:40
Subject: Config on Netbeans for OS X Panther

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