Re: PQstatus() detect change in connection...
| От | Tom Lane |
|---|---|
| Тема | Re: PQstatus() detect change in connection... |
| Дата | |
| Msg-id | 24856.1003428619@sss.pgh.pa.us обсуждение |
| Ответ на | Re: PQstatus() detect change in connection... (Matthew Hagerty <mhagerty@voyager.net>) |
| Ответы |
Re: PQstatus() detect change in connection...
|
| Список | pgsql-hackers |
Matthew Hagerty <mhagerty@voyager.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
В списке pgsql-hackers по дате отправления: