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

From Tom Lane
Subject Re: BUG #5837: PQstatus() fails to report lost connection
Date
Msg-id 9838.1295890896@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #5837: PQstatus() fails to report lost connection  ("Murray S. Kucherawy" <msk@cloudmark.com>)
Responses Re: BUG #5837: PQstatus() fails to report lost connection  ("Murray S. Kucherawy" <msk@cloudmark.com>)
List pgsql-bugs
"Murray S. Kucherawy" <msk@cloudmark.com> 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

pgsql-bugs by date:

Previous
From: "Murray S. Kucherawy"
Date:
Subject: Re: BUG #5837: PQstatus() fails to report lost connection
Next
From: "Kevin Grittner"
Date:
Subject: Re: BUG #5837: PQstatus() fails to report lost connection