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

2011-03-11 Thread Merlin Moncure
esql.org >> Subject: Re: [BUGS] BUG #5837: PQstatus() fails to report lost connection >> >> I think the real, underlying problem here is that Murray would like a >> behavior change: when a FATAL or PANIC condition is reported by the >> server, he'd like th

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

2011-03-11 Thread Bruce Momjian
Robert Haas wrote: > On Fri, Mar 11, 2011 at 5:56 AM, Bruce Momjian wrote: > > Robert Haas wrote: > >> On Tue, Jan 25, 2011 at 10:54 AM, Kevin Grittner > >> wrote: > >> > Robert Haas wrote: > >> >> I think this patch would only be adding to the confusion. ?When > >> >> PQgetResult() is called, w

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

2011-03-11 Thread Robert Haas
On Fri, Mar 11, 2011 at 5:56 AM, Bruce Momjian wrote: > Robert Haas wrote: >> On Tue, Jan 25, 2011 at 10:54 AM, Kevin Grittner >> wrote: >> > Robert Haas wrote: >> >> I think this patch would only be adding to the confusion. ?When >> >> PQgetResult() is called, we read enough data from the conne

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

2011-03-11 Thread Bruce Momjian
Robert Haas wrote: > On Tue, Jan 25, 2011 at 10:54 AM, Kevin Grittner > wrote: > > 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

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

2011-01-25 Thread Murray S. Kucherawy
> -Original Message- > From: Robert Haas [mailto:robertmh...@gmail.com] > Sent: Tuesday, January 25, 2011 7:33 AM > To: Kevin Grittner > Cc: Murray S. Kucherawy; Tom Lane; pgsql-bugs@postgresql.org > Subject: Re: [BUGS] BUG #5837: PQstatus() fails to report lost connectio

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

2011-01-25 Thread Robert Haas
On Tue, Jan 25, 2011 at 10:54 AM, Kevin Grittner wrote: > 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 necessaril

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

2011-01-25 Thread Kevin Grittner
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 ju

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

2011-01-25 Thread Robert Haas
On Mon, Jan 24, 2011 at 1:47 PM, Kevin Grittner wrote: > "Murray S. Kucherawy" wrote: >> From: Kevin Grittner [mailto:kevin.gritt...@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 af

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

2011-01-24 Thread Murray S. Kucherawy
> -Original Message- > From: Kevin Grittner [mailto:kevin.gritt...@wicourts.gov] > Sent: Monday, January 24, 2011 10:47 AM > To: Murray S. Kucherawy; Tom Lane > Cc: Robert Haas; pgsql-bugs@postgresql.org > Subject: RE: [BUGS] BUG #5837: PQstatus() fails to report lost

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

2011-01-24 Thread Kevin Grittner
"Murray S. Kucherawy" wrote: > From: Kevin Grittner [mailto:kevin.gritt...@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 indic

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

2011-01-24 Thread Murray S. Kucherawy
> -Original Message- > From: Kevin Grittner [mailto:kevin.gritt...@wicourts.gov] > Sent: Monday, January 24, 2011 9:50 AM > To: Murray S. Kucherawy; Tom Lane > Cc: Robert Haas; pgsql-bugs@postgresql.org > Subject: Re: [BUGS] BUG #5837: PQstatus() fails to repo

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

2011-01-24 Thread Murray S. Kucherawy
> -Original Message- > From: Tom Lane [mailto:t...@sss.pgh.pa.us] > Sent: Monday, January 24, 2011 9:42 AM > To: Murray S. Kucherawy > Cc: Robert Haas; pgsql-bugs@postgresql.org > Subject: Re: [BUGS] BUG #5837: PQstatus() fails to report lost connection > > >

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

2011-01-24 Thread Kevin Grittner
"Murray S. Kucherawy" wrote: > Please, at a minimum, add some documentation about it. Current documentation at: http://www.postgresql.org/docs/9.0/interactive/libpq-async.html says: | PQgetResult must be called repeatedly until it returns a null | pointer, indicating that the command is

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

2011-01-24 Thread Tom Lane
"Murray S. Kucherawy" writes: > From: Tom Lane [mailto:t...@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 >> PQsta

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

2011-01-24 Thread Murray S. Kucherawy
> -Original Message- > From: Tom Lane [mailto:t...@sss.pgh.pa.us] > Sent: Monday, January 24, 2011 7:30 AM > To: Murray S. Kucherawy > Cc: Robert Haas; pgsql-bugs@postgresql.org > Subject: Re: [BUGS] BUG #5837: PQstatus() fails to report lost connection > > "

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

2011-01-24 Thread Tom Lane
"Murray S. Kucherawy" writes: > Given what you say here, this seems to be an exception for which there > is currently no detection mechanism short of looking for that one > specific error string indicating it was administrative action causing > the error. This is complete nonsense. If you follow

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

2011-01-24 Thread Tom Lane
Robert Haas writes: > On Sat, Jan 22, 2011 at 10:44 PM, Tom Lane wrote: >> What did you do exactly?  testlibpq.c just uses PQexec(), and AFAICS the >> connection status does end up BAD if the backend is terminated before a >> PQexec starts. > PFA. Yeah, that was my first cut at it too, but it's

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

2011-01-24 Thread Robert Haas
On Mon, Jan 24, 2011 at 12:59 AM, Murray S. Kucherawy wrote: > Well my other suggestion would be to assume PGRES_FATAL_ERROR always means > the connection needs to be reset.  But this blows that idea away; this would > cause a connection reset that wouldn't actually solve the problem when it's

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

2011-01-24 Thread Murray S. Kucherawy
> -Original Message- > From: Robert Haas [mailto:robertmh...@gmail.com] > Sent: Sunday, January 23, 2011 8:59 PM > To: Murray S. Kucherawy > Cc: Tom Lane; pgsql-bugs@postgresql.org > Subject: Re: [BUGS] BUG #5837: PQstatus() fails to report lost connection > > >

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

2011-01-24 Thread Murray S. Kucherawy
> -Original Message- > From: Tom Lane [mailto:t...@sss.pgh.pa.us] > Sent: Saturday, January 22, 2011 7:44 PM > To: Robert Haas > Cc: Murray S. Kucherawy; pgsql-bugs@postgresql.org > Subject: Re: [BUGS] BUG #5837: PQstatus() fails to report lost connection > > Rob

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

2011-01-23 Thread Robert Haas
On Sun, Jan 23, 2011 at 10:59 PM, Murray S. Kucherawy wrote: > As for the reply above, I disagree.  PQstatus(), as documented, doesn't say > anything about certain conditions in which it won't report that the > connection is dead, when it actually is, once the connection was already > establis

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

2011-01-23 Thread Robert Haas
On Sat, Jan 22, 2011 at 10:44 PM, Tom Lane wrote: > What did you do exactly?  testlibpq.c just uses PQexec(), and AFAICS the > connection status does end up BAD if the backend is terminated before a > PQexec starts. PFA. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise Po

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

2011-01-22 Thread Tom Lane
Robert Haas writes: > On Thu, Jan 13, 2011 at 8:36 PM, Murray S. Kucherawy > wrote: >> 1) establish a connection to postgresql >> 2) initiate a query, collect results, etc.; all normal >> 3) while client is idle, restart the server >> 4) initiate the very same query as before >> 5) call PQgetRes

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

2011-01-22 Thread Robert Haas
On Thu, Jan 13, 2011 at 8:36 PM, Murray S. Kucherawy wrote: > > The following bug has been logged online: > > Bug reference:      5837 > Logged by:          Murray S. Kucherawy > Email address:      m...@cloudmark.com > PostgreSQL version: 9.0.2 > Operating system:   FreeBSD > Description:        

[BUGS] BUG #5837: PQstatus() fails to report lost connection

2011-01-13 Thread Murray S. Kucherawy
The following bug has been logged online: Bug reference: 5837 Logged by: Murray S. Kucherawy Email address: m...@cloudmark.com PostgreSQL version: 9.0.2 Operating system: FreeBSD Description:PQstatus() fails to report lost connection Details: I'm accessing libpq via