Re: BUG #5837: PQstatus() fails to report lost connection

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Murray S(dot) Kucherawy" <msk(at)cloudmark(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #5837: PQstatus() fails to report lost connection
Date: 2011-01-24 17:41:36
Message-ID: 9838.1295890896@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"Murray S. Kucherawy" <msk(at)cloudmark(dot)com> writes:
> From: Tom Lane [mailto:tgl(at)sss(dot)pgh(dot)pa(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Kevin Grittner 2011-01-24 17:49:52 Re: BUG #5837: PQstatus() fails to report lost connection
Previous Message Murray S. Kucherawy 2011-01-24 17:26:36 Re: BUG #5837: PQstatus() fails to report lost connection