Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 3D66F1336B42 for ; Mon, 24 Jan 2011 13:41:46 -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 68824-01 for ; Mon, 24 Jan 2011 17:41:39 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id A88CD133655C for ; Mon, 24 Jan 2011 13:41:38 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p0OHfaff009839; Mon, 24 Jan 2011 12:41:36 -0500 (EST) To: "Murray S. Kucherawy" cc: Robert Haas , "pgsql-bugs@postgresql.org" Subject: Re: BUG #5837: PQstatus() fails to report lost connection In-reply-to: References: <201101140136.p0E1aTFb017852@wwwmaster.postgresql.org> <1950.1295754244@sss.pgh.pa.us> <6493.1295882981@sss.pgh.pa.us> Comments: In-reply-to "Murray S. Kucherawy" message dated "Mon, 24 Jan 2011 09:26:36 -0800" Date: Mon, 24 Jan 2011 12:41:36 -0500 Message-ID: <9838.1295890896@sss.pgh.pa.us> From: Tom Lane 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/169 X-Sequence-Number: 29191 "Murray S. Kucherawy" writes: > From: Tom Lane [mailto:tgl@sss.pgh.pa.us] >> 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 connection status to see if it was bad to begin with," can be politely described as counter-intuitive. [ shrug... ] I guess if your intuition is that PQstatus should be expected to intuit the failure of a call that hasn't happened yet, then it's counter-intuitive. regards, tom lane