pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kevin Grittner <Kevin.Grittner@wicourts.gov>
To: Murray S. Kucherawy <msk@cloudmark.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: pgsql-bugs@postgresql.org <pgsql-bugs@postgresql.org>
Subject: Re: BUG #5837: PQstatus() fails to report lost connection
Date: Mon, 24 Jan 2011 12:47:18 -0600
Message-ID: <4D3D74D60200002500039B3C@gw.wicourts.gov> (raw)
In-Reply-To: <F5833273385BB34F99288B3648C4F06F1341E73FCD@EXCH-C2.corp.cloudmark.com>
References: <201101140136.p0E1aTFb017852@wwwmaster.postgresql.org>
	<AANLkTinZAdPCX685ecg2_eVXJ1vDNXL4Ki-B1rFN=Z3h@mail.gmail.com>
	<1950.1295754244@sss.pgh.pa.us>
	<F5833273385BB34F99288B3648C4F06F1341E73FC4@EXCH-C2.corp.cloudmark.com>
	<AANLkTi=rSATsN+3UD5feWm3ntsB=6jqAFBZWdTZ7ZfaO@mail.gmail.com>
	<F5833273385BB34F99288B3648C4F06F1341E73FC6@EXCH-C2.corp.cloudmark.com>
	<6493.1295882981@sss.pgh.pa.us>
	<F5833273385BB34F99288B3648C4F06F1341E73FCB@EXCH-C2.corp.cloudmark.com>
	<4D3D67600200002500039B2C@gw.wicourts.gov>
	<F5833273385BB34F99288B3648C4F06F1341E73FCD@EXCH-C2.corp.cloudmark.com>

"Murray S. Kucherawy" <msk@cloudmark.com> wrote:
> From: Kevin Grittner [mailto:Kevin.Grittner@wicourts.gov]
 
>> What do you think would make this more clear?
 
> So maybe something like this after the paragraph you cited would
> help:
> 
> "Note that after returning a PGresult object, PQresultStatus()
> could indicate a fatal error.  The caller should still iterate
> calling PQgetResult() to completion (i.e. until it returns NULL)
> in order to allow libpq to process the error information
> completely."
 
A patch based on this suggestion attached for consideration by the
community.
 
-Kevin

Attachments:

PQgetResult-doc.patch (text/plain, 687B) download *** a/doc/src/sgml/libpq.sgml --- b/doc/src/sgml/libpq.sgml *************** *** 3827,3832 **** PGresult *PQgetResult(PGconn *conn); --- 3827,3841 ---- active and the necessary response data has not yet been read by <function>PQconsumeInput</function>. </para> + + <note> + <para> + Even when <function>PQresultStatus</function> indicates a fatal + error, <function>PQgetResult</function> must be called until it + returns a null pointer. This allows <application>libpq</> to + process the error information completely. + </para> + </note> </listitem> </varlistentry> </variablelist>

view thread (25+ messages)  latest in thread

Message-ID: <4D3D74D60200002500039B3C@gw.wicourts.gov>
Permalink:  ../4D3D74D60200002500039B3C@gw.wicourts.gov/
Also on:    postgresql.org/message-id/4D3D74D60200002500039B3C@gw.wicourts.gov

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: Kevin.Grittner@wicourts.gov, msk@cloudmark.com, tgl@sss.pgh.pa.us, robertmhaas@gmail.com
  Subject: Re: BUG #5837: PQstatus() fails to report lost connection
  In-Reply-To: <4D3D74D60200002500039B3C@gw.wicourts.gov>
  References: <201101140136.p0E1aTFb017852@wwwmaster.postgresql.org> <AANLkTinZAdPCX685ecg2_eVXJ1vDNXL4Ki-B1rFN=Z3h@mail.gmail.com> <1950.1295754244@sss.pgh.pa.us> <F5833273385BB34F99288B3648C4F06F1341E73FC4@EXCH-C2.corp.cloudmark.com> <AANLkTi=rSATsN+3UD5feWm3ntsB=6jqAFBZWdTZ7ZfaO@mail.gmail.com> <F5833273385BB34F99288B3648C4F06F1341E73FC6@EXCH-C2.corp.cloudmark.com> <6493.1295882981@sss.pgh.pa.us> <F5833273385BB34F99288B3648C4F06F1341E73FCB@EXCH-C2.corp.cloudmark.com> <4D3D67600200002500039B2C@gw.wicourts.gov> <F5833273385BB34F99288B3648C4F06F1341E73FCD@EXCH-C2.corp.cloudmark.com> <4D3D74D60200002500039B3C@gw.wicourts.gov>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox