Re: Current transaction is aborted, commands ignored until end of transaction block

From: Feike Steenbergen <feikesteenbergen(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Current transaction is aborted, commands ignored until end of transaction block
Date: 2012-01-05 06:20:36
Message-ID: CAK_s-G0rs=D2t55N+opbBfq9O2p8Y1X9Fve70OdcawxMe7Oiag@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

I recently started receiving this error as well, this was because I
disabled autocommit.
With the following option in .psqlrc the error doesn't wait for a
rollback but automatically creates a savepoint allowing you to fix the
error and continue:

This is now in my .psqlrc:

\set AUTOCOMMIT off
\set ON_ERROR_ROLLBACK on

http://www.postgresql.org/docs/9.1/static/app-psql.html look for
ON_ERROR_ROLLBACK

"When on, if a statement in a transaction block generates an error,
the error is ignored and the transaction continues. When interactive,
such errors are only ignored in interactive sessions, and not when
reading script files."

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Carlos Mennens 2012-01-05 13:55:30 When To Use Quotes
Previous Message rverghese 2012-01-04 17:34:35 Re: ignore unique violation OR check row exists