Re: PQstatus() detect change in connection...

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Matthew Hagerty <mhagerty(at)voyager(dot)net>
Cc: "Mark Pritchard" <mark(at)tangent(dot)net(dot)au>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: PQstatus() detect change in connection...
Date: 2001-10-18 18:10:19
Message-ID: 24856.1003428619@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Matthew Hagerty <mhagerty(at)voyager(dot)net> writes:
> Anyone know a good *fast* way to test
> if a socket is still valid?

What exactly are you trying to defend against?

In general, I don't believe that there is any way of discovering whether
the server is still up, other than to send it a query. (FWIW, an empty
query string bounces back very quickly, with little processing.)

For particular scenarios it's possible that some notification has been
delivered to the client, but if you have had (say) a loss of network
connectivity then there just is no other alternative. Your end isn't
going to discover the connectivity loss until it tries to send a
message.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2001-10-18 18:18:34 Re: To Postgres Devs : Wouldn't changing the select limit
Previous Message Tom Lane 2001-10-18 17:58:30 Re: autoconf taking forever?