From: Matthew Vanecek <mevanecek@yahoo.com>
To: Postgresql Interfaces List <pgsql-interfaces@postgresql.org>
Subject: Re: debug a mess
Date: 25 Feb 2003 14:29:56 -0600
Message-ID: <1046204996.12261.65.camel@reliant.home.pri> (raw)
In-Reply-To: <20030225134154.A23392@example.com>
References: <20030225134154.A23392@example.com>
On Tue, 2003-02-25 at 12:41, Wei Weng wrote:
> I am trying to figure out where the "NOTICE: current transaction is aborted,
> queries ignored until end of transaction block" comes from in my code.
> Basically, this is what it does:
>
> CString strQuery
> = "SELECT datname FROM pg_database WHERE name = 'mydatabase'";
>
> if (NULL == (res = PQexec(pgconn, (CSTR) strQuery)))
> {
> ErrorQuit(PQerrorMessage(pgconn));
> }
>
> It is really very simple code, but each time I try to run it, the postgresql
> backend gives me the "transaction aborted" error message. I checked the
> mailing list archive, and Tom once explained that the reason for this error
> message is the backend had quitted for some reason. Is there anyway to see
> why the backend aborted the transaction?? It could be really helpful.
>
It sounds like you've executed a query or command, and have not called
PQclear(result) on the results. Whenever I've gottten that error, not
clearing the results has always been the root cause. Make sure result
is not NULL first, of course...
--
Matthew Vanecek
perl -e 'print $i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10);'
********************************************************************************
For 93 million miles, there is nothing between the sun and my shadow except me.
I'm always getting in the way of something...
Attachments:
signature.asc (application/pgp-signature, 231B) download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: mevanecek@yahoo.com
Subject: Re: debug a mess
In-Reply-To: <1046204996.12261.65.camel@reliant.home.pri>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox