handling duplicate row exception

From: Amar Dhole <adhole(at)tibco(dot)com>
To: "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgresql(dot)org>
Subject: handling duplicate row exception
Date: 2011-09-21 05:54:55
Message-ID: B056671652AA4D418763981054BCEAB408F1BF@PA-MBX04.na.tibco.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi All,

I have a requirement where my application tries to enter the duplicate row in table using batchexceute code. And batch exception is thrown we checked error code and skip it but after this exception all my next update/insert gets error out with following exception

"Database error. SQL state 25P02. Database specific error code (if any) was 0. Database error message (if any) was: org.postgresql.util.PSQLException: ERROR: current transaction is aborted, commands ignored until end of transaction block.:

Is there any way to proceed ahead like in sql server we have options while creating table IGNORE_DUP_KEY = ON if this is set warning is generated instead of Exception so the other insert/update can proceed ahead.

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Filip Rembiałkowski 2011-09-21 15:07:29 Re: handling duplicate row exception
Previous Message Thomas Kellerer 2011-09-20 14:54:28 Re: Combining several CTEs with a recursive CTE