Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 0512B1337B39 for ; Tue, 25 Jan 2011 11:54:23 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 56378-03 for ; Tue, 25 Jan 2011 15:54:16 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from gw.wicourts.gov (gwmta.wicourts.gov [165.219.244.99]) by mail.postgresql.org (Postfix) with ESMTP id 67B2D133798E for ; Tue, 25 Jan 2011 11:54:15 -0400 (AST) Received: from Courts-MTA by gw.wicourts.gov with Novell_GroupWise; Tue, 25 Jan 2011 09:54:15 -0600 Message-Id: <4D3E9DBD0200002500039C36@gw.wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 8.0.1 Date: Tue, 25 Jan 2011 09:54:05 -0600 From: "Kevin Grittner" To: "Robert Haas" Cc: "Murray S. Kucherawy" , "pgsql-bugs@postgresql.org" , "Tom Lane" Subject: Re: BUG #5837: PQstatus() fails to report lost connection References: <201101140136.p0E1aTFb017852@wwwmaster.postgresql.org> <1950.1295754244@sss.pgh.pa.us> <6493.1295882981@sss.pgh.pa.us> <4D3D67600200002500039B2C@gw.wicourts.gov> <4D3D74D60200002500039B3C@gw.wicourts.gov> In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-4.21 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201101/191 X-Sequence-Number: 29213 Robert Haas wrote: > I think this patch would only be adding to the confusion. When > PQgetResult() is called, we read enough data from the connection > to create and return one result object. It's true that this > doesn't necessarily detect an EOF, but IIUC calling PQgetResult() > again is just ONE way that you could trigger another read against > the socket, not the only one. I think it would also work to call > PQconsumeInput(), for example. I find it hard to reconcile the above with this: http://archives.postgresql.org/message-id/6493.1295882981@sss.pgh.pa.us and the quote from our documentation referenced here: http://archives.postgresql.org/message-id/4D3D67600200002500039B2C@gw.wicourts.gov > I think the real, underlying problem here is that Murray would > like a behavior change More than that I think he wants to be able to read the manual and know what will work, without spending loads of time getting in tune with The Tao of Libpq. Based on his initial reading of the docs he expected different behavior; that can be fixed by changing the behavior or changing the docs. -Kevin