Re: Recovering from failed transaction

Поиск
Список
Период
Сортировка
От Jeff Janes
Тема Re: Recovering from failed transaction
Дата
Msg-id CAMkU=1ySYe7GAfSTVRwoJnCmfLb9s31WFph5ARPQ-CVBZq0_RA@mail.gmail.com
обсуждение исходный текст
Ответ на Recovering from failed transaction  (Brian Crowell <brian@fluggo.com>)
Ответы Re: Recovering from failed transaction  (Brian Crowell <brian@fluggo.com>)
Список pgsql-general
On Mon, Mar 10, 2014 at 1:41 PM, Brian Crowell <brian@fluggo.com> wrote:
I feel dumb asking this question, but I can't seem to find the answer online.

I'm running serializable transactions, and so naturally, they will
sometimes fail with the error "could not serialize access due to
concurrent update."

But then I try to issue a ROLLBACK so I can continue using the
connection, and I get error 25P02: "current transaction is aborted,
commands ignored until end of transaction block."

...doesn't "ROLLBACK" end a transaction block? What does Postgres want
here? How can I retry without closing the connection altogether?

What tool are you using to connect to the database?  Perhaps it is confusing the error response to some earlier statement in the stream with the response for the rollback.  Or maybe it is mangling the "ROLLBACK;" into some form the database doesn't recognize.  Look in the postgres log files to see what the events look like from PostgreSQL's perspective.

Cheers,

Jeff

В списке pgsql-general по дате отправления:

Предыдущее
От: Brian Crowell
Дата:
Сообщение: Recovering from failed transaction
Следующее
От: Matthew Chambers
Дата:
Сообщение: bg writer went away after reload