Re: BUG #5837: PQstatus() fails to report lost connection - Mailing list pgsql-bugs

From Robert Haas
Subject Re: BUG #5837: PQstatus() fails to report lost connection
Date
Msg-id AANLkTikZr7Zg-BxC5bSNtzskBUK-nn_dOcTxVOnGLF_P@mail.gmail.com
Whole thread Raw
In response to Re: BUG #5837: PQstatus() fails to report lost connection  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Responses Re: BUG #5837: PQstatus() fails to report lost connection  (Bruce Momjian <bruce@momjian.us>)
List pgsql-bugs
On Tue, Jan 25, 2011 at 10:54 AM, Kevin Grittner
<Kevin.Grittner@wicourts.gov> wrote:
> Robert Haas <robertmhaas@gmail.com> wrote:
>> I think this patch would only be adding to the confusion. =A0When
>> PQgetResult() is called, we read enough data from the connection
>> to create and return one result object. =A0It'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. =A0I 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.wic=
ourts.gov

IIUC, Tom's point was that doing it that way would detect the error,
not that it was the ONLY way to detect the error.

But it's easily testable.

>> 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. =A0Based on his initial reading of the docs he
> expected different behavior; that can be fixed by changing the
> behavior or changing the docs.

That is why I suggested the type of doc correction that I thought
would be most helpful and accurate.

--=20
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

pgsql-bugs by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: BUG #5837: PQstatus() fails to report lost connection
Next
From: Josh Berkus
Date:
Subject: Multicolun index creation never completes on 9.0.1/solaris