Re: PQstatus() detect change in connection... - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: PQstatus() detect change in connection...
Date
Msg-id Pine.LNX.4.30.0110182005470.633-100000@peter.localdomain
Whole thread Raw
In response to Re: PQstatus() detect change in connection...  (Matthew Hagerty <mhagerty@voyager.net>)
List pgsql-hackers
Matthew Hagerty writes:

> I am trying to re-establish a connection, however, I cannot afford to issue
> a query to determine if the connection still exists.

But requesting that the server do something *is* the only way to know
whether it's still alive.  Another question to ask, of course, would be,
why is your server always going down?

> I've been digging into the libpq code to see what is going on, maybe I can
> gleam a little hint or two  there...  Anyone know a good *fast* way to test
> if a socket is still valid?

Try to send or receive something.

-- 
Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: compiling libpq++ on Solaris with Sun SPRO6U2 (fixed
Next
From: Peter Eisentraut
Date:
Subject: Re: autoconf taking forever?