Re: Get status of connection (C)

Поиск
Список
Период
Сортировка
От Tim Barnard
Тема Re: Get status of connection (C)
Дата
Msg-id 006301c0e860$287c19a0$a519af3f@hartcomm.com
обсуждение исходный текст
Ответ на Get status of connection (C)  (zilch@home.se)
Список pgsql-general
Page 4 of the programmers reference states:
"At any time during connection, the status of the
connection may be checked, by calling PQstatus."
I use it and so far its worked great, by which I mean
it has subsequently reported bad connections after
having reported CONNECTION_OK, which has
happened when the backend has died.

Tim

----- Original Message -----
From: <zilch@home.se>
To: <pgsql-general@postgresql.org>
Sent: Tuesday, May 29, 2001 2:46 AM
Subject: [GENERAL] Get status of connection (C)


>
> I'm writing a pool manager to manage x connections to a pgsql postmaster.
>
> The getConnection method has to check if the connection is still valid,
> and try to reconnect if it ain't.
>
> Do you guys have a good way of doing this?
>
> Can I use PQstatus?
>
> Should I make a little runCommand on it to try it out? Then what command?
>
> If it's bad, should I run a PQfinish on it before reconnecting or not?
>
> Thank you plenty!
>
> ---
> Daniel Akerud
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
>


В списке pgsql-general по дате отправления:

Предыдущее
От: "Tim Barnard"
Дата:
Сообщение: Re: Re: [SQL] Difficult SQL Statement
Следующее
От: Arcady Genkin
Дата:
Сообщение: Changing path to /tmp/.s.PGSQL.5432 file and the .lock file