Re: BUG #2370: 25P02,current transaction is aborted, commands ignored until end of transaction block - Mailing list pgsql-bugs

From Alvaro Herrera
Subject Re: BUG #2370: 25P02,current transaction is aborted, commands ignored until end of transaction block
Date
Msg-id 20060403003647.GB27131@surnet.cl
Whole thread Raw
In response to BUG #2370: 25P02,current transaction is aborted, commands ignored until end of transaction block  ("Amaresh Wakkar" <babu_moshay@indiatimes.com>)
List pgsql-bugs
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

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #2369: pg_dump function dependencies
Next
From: Richard Huxton
Date:
Subject: Re: BUG #2364: DB Error: connect failed ... PHP/PostgreSql