Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 95C161337B99 for ; Mon, 24 Jan 2011 13:26:52 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 62743-07 for ; Mon, 24 Jan 2011 17:26:44 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from ht2-outbound.cloudmark.com (ht2-outbound.cloudmark.com [72.5.239.36]) by mail.postgresql.org (Postfix) with ESMTP id 81A901337B98 for ; Mon, 24 Jan 2011 13:26:39 -0400 (AST) Received: from EXCH-C2.corp.cloudmark.com ([172.22.1.74]) by spite.corp.cloudmark.com ([172.22.10.72]) with mapi; Mon, 24 Jan 2011 09:26:38 -0800 From: "Murray S. Kucherawy" To: Tom Lane CC: Robert Haas , "pgsql-bugs@postgresql.org" Date: Mon, 24 Jan 2011 09:26:36 -0800 Subject: Re: BUG #5837: PQstatus() fails to report lost connection Thread-Topic: [BUGS] BUG #5837: PQstatus() fails to report lost connection Thread-Index: Acu724ZBXGCaFcJkRNmcEIPfr73xtgAD9iFw Message-ID: References: <201101140136.p0E1aTFb017852@wwwmaster.postgresql.org> <1950.1295754244@sss.pgh.pa.us> <6493.1295882981@sss.pgh.pa.us> In-Reply-To: <6493.1295882981@sss.pgh.pa.us> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201101/168 X-Sequence-Number: 29190 > -----Original Message----- > From: Tom Lane [mailto:tgl@sss.pgh.pa.us] > Sent: Monday, January 24, 2011 7:30 AM > To: Murray S. Kucherawy > Cc: Robert Haas; pgsql-bugs@postgresql.org > Subject: Re: [BUGS] BUG #5837: PQstatus() fails to report lost connection >=20 > "Murray S. Kucherawy" writes: > > Given what you say here, this seems to be an exception for which there > > is currently no detection mechanism short of looking for that one > > specific error string indicating it was administrative action causing > > the error. >=20 > This is complete nonsense. If you followed the documented method for > using PQgetResult -- ie, keep calling it till it returns NULL, rather > than assuming there will be a specific number of results --- then > PQstatus would show you the bad status afterwards. Your assertion here of "Read the result set to exhaustion, THEN check conne= ction status to see if it was bad to begin with," can be politely described= as counter-intuitive. Please, at a minimum, add some documentation about it.