Recovering from failed transaction

From: Brian Crowell <brian(at)fluggo(dot)com>
To: "pgsql-general(at)postgresql(dot)org >> PG-General Mailing List" <pgsql-general(at)postgresql(dot)org>
Subject: Recovering from failed transaction
Date: 2014-03-10 20:41:35
Message-ID: CAAQkdDrBoW3UUdGVRzdvqOe0-R+jKfjWLe66wOSmKogd8Po0ww@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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?

--Brian

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jeff Janes 2014-03-10 21:16:12 Re: Recovering from failed transaction
Previous Message Aggarwal, Ajay 2014-03-10 20:07:45 Re: replication timeout in pg_basebackup