Amaresh Wakkar wrote:
> 3.In one of the inserts we must ignore the failure due to duplicate rows i.e
> Error state 23505 and continue with remainder set of inserts. Presence of
> duplicate rows will not be treated as an error condition in this context and
> system must function normally without aborting the whole transaction (This
> is what PostgreSQL is doing currently after first failure I get 25P02 and
> all other inserts are ignored completely). I get following error:
>
> org.postgresql.util.PSQLException: ERROR: current transaction is aborted,
> commands ignored until end of transaction block
Sure. You can set a SAVEPOINT before trying the insert; if it fails,
ROLLBACK TO said savepoint and you can continue merrily with the rest of
your transaction.
--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support