Re: troubleshooting PGError

From: "David Johnston" <polobo(at)yahoo(dot)com>
To: "'slavix'" <mikerin(dot)slava(at)gmail(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: troubleshooting PGError
Date: 2011-11-10 20:10:57
Message-ID: 00c301cc9fe4$dc85fc30$9591f490$@yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

-----Original Message-----
From: pgsql-general-owner(at)postgresql(dot)org
[mailto:pgsql-general-owner(at)postgresql(dot)org] On Behalf Of slavix
Sent: Wednesday, November 09, 2011 12:03 AM
To: pgsql-general(at)postgresql(dot)org
Subject: [GENERAL] troubleshooting PGError

Hello,
I am new to postgres, but need to resolve this error:

PGError: ERROR: current transaction is aborted, commands ignored until end
of transaction block
: SELECT 1 FROM "trades" WHERE ("trades"."uuid" =
'bc8d86e6-0a8d-11e1-a345-001d09203579' AND "trades"."id" != 25) LIMIT
1

Don't know what is the problem, tried running the same query in pgAdmin and
the query runs fine..
I don't know what the error actually is since the error message is not
clear. Any ideas on how to investigate this?

thank you.

--------------------------------

The error message is very clear; if you understand what a transaction is.

You are executing a number of statements in a single transaction and one of
previous ones failed. You should see another error message earlier that was
the true failure. All this message is saying that because the transaction
had a failure all subsequent statements that belong to the same transaction
will be ignored since, at the end of the transaction, everything is going to
be rolled-back anyway.

If you are still confused you need to provide more details about your
programming environment and all the statements that you are bundling into
the same transaction at the statement shown; and a significant section of
the PostgreSQL log file would help as well.

This normally doesn't show up since you usually want to stop processing a
transaction as soon as a failure occurs. If you provide the entire
transaction to PostgreSQL all at once then PostgreSQL will normally stop
processing as soon as it encounters an error and will return that error.
However, if you take manual control of the transaction in your programming
environment then if you attempt to execute additional statements even after
an error is thrown PostgreSQL will throw the error you are seeing saying
that, in effect, your attempt to execute a statement is pointless.

David J.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message J.V. 2011-11-10 21:30:07 PostgreSQL uninstall fails
Previous Message Kaspars Zelgis 2011-11-10 20:09:26 (bez temata)