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: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
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
> 


---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://www.postgresql.org/search.mpl

Reply via email to