X-Original-To: pgsql-interfaces@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id D4C02474E5C for ; Tue, 25 Feb 2003 15:41:58 -0500 (EST) Received: from postgresql.org ([64.49.215.8]) by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with SMTP id 83706-03 for ; Tue, 25 Feb 2003 15:41:30 -0500 (EST) Received: from crtntx1-ar11-4-62-011-208.crtntx1.dsl-verizon.net (crtntx1-ar11-4-62-009-178.crtntx1.dsl-verizon.net [4.62.9.178]) by postgresql.org (Postfix) with ESMTP id 8AEC5475DD0 for ; Tue, 25 Feb 2003 15:29:53 -0500 (EST) Received: from reliant.home.pri (reliant.home.pri [192.168.1.25]) by crtntx1-ar11-4-62-011-208.crtntx1.dsl-verizon.net (Postfix) with ESMTP id 54BDA3018 for ; Tue, 25 Feb 2003 14:30:09 -0600 (CST) Subject: Re: debug a mess From: Matthew Vanecek To: Postgresql Interfaces List In-Reply-To: <20030225134154.A23392@example.com> References: <20030225134154.A23392@example.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-xo7eVfRurm9+8SdSlxIw" Organization: Message-Id: <1046204996.12261.65.camel@reliant.home.pri> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 25 Feb 2003 14:29:56 -0600 X-Virus-Scanned: by amavisd-new X-Archive-Number: 200302/105 X-Sequence-Number: 3726 --=-xo7eVfRurm9+8SdSlxIw Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Tue, 2003-02-25 at 12:41, Wei Weng wrote: > I am trying to figure out where the "NOTICE: current transaction is abor= ted, > queries ignored until end of transaction block" comes from in my code. > Basically, this is what it does: >=20 > CString strQuery=20 > =3D "SELECT datname FROM pg_database WHERE name =3D 'mydatabase'"; >=20 > if (NULL =3D=3D (res =3D PQexec(pgconn, (CSTR) strQuery))) > { > ErrorQuit(PQerrorMessage(pgconn)); > } >=20 > It is really very simple code, but each time I try to run it, the postgre= sql > backend gives me the "transaction aborted" error message. I checked the > mailing list archive, and Tom once explained that the reason for this err= or > 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. >=20 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... --=20 Matthew Vanecek perl -e 'print $i=3Dpack(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... --=-xo7eVfRurm9+8SdSlxIw Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQA+W9JDi/CNzDSN0RIRAi+eAJ9v2kG+wPexPuW7diwAdNgkzSFzAQCffW8b mbsDCq4tGrwWnBBf7kwOSrA= =Q682 -----END PGP SIGNATURE----- --=-xo7eVfRurm9+8SdSlxIw--