Re: BUG #2370: 25P02,current transaction is aborted, commands ignored until end of transaction block

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: BUG #2370: 25P02,current transaction is aborted, commands ignored until end of transaction block
Дата
Msg-id 20060403003647.GB27131@surnet.cl
обсуждение исходный текст
Ответ на BUG #2370: 25P02,current transaction is aborted, commands ignored until end of transaction block  ("Amaresh Wakkar" <babu_moshay@indiatimes.com>)
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #2369: pg_dump function dependencies
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: BUG #2364: DB Error: connect failed ... PHP/PostgreSql