Re: current transaction is aborted, commands ignored

From: Scott Marlowe <smarlowe(at)g2switchworks(dot)com>
To: Thomas Kellerer <spam_eater(at)gmx(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: current transaction is aborted, commands ignored
Date: 2005-04-18 22:26:36
Message-ID: 1113863196.20921.538.camel@state.g2switchworks.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, 2005-04-18 at 17:09, Thomas Kellerer wrote:
> Hello,
>
> I'm having a bit of trouble with the error message from the subject. Is
> there a way to simply go on with my commands if I hit this error?
>
> One example would be when I drop a table (and it doesn't exist) I still
> want to run the following CREATE TABLE. But due to the error even the
> following valid command will fail.
> This problem is not limited to DDL. When I try to write the result sets for
> several queries to disk it's the same problem, if e.g. the first select
> reports an error (e.g. due to a typo in the column list) all subsequent
> ones will no run as well.
>
> I know that I can "fix" this state by issuing a rollback (or commit). The
> problem is, that this stuff is part of a bigger program, and I cannot
> determine whether I'm allowed to do a rollback or commit at that point.
>
> Is this a problem with the JDBC interface that I'm using, or is this a
> general Postgres problem?
>
> Is there a setting where I can control this behaviour?
>
> I'm using 8.0.2 on Windows 2000 (and XP)

You could try using rollback and save points. set savepoint before you
drop the table, and if the drop fails, issue a rollback.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Thomas Kellerer 2005-04-18 22:59:06 Re: current transaction is aborted, commands ignored until
Previous Message Joshua D. Drake 2005-04-18 22:21:14 Re: current transaction is aborted, commands ignored until