PQstatus is not returning

"Sunil Khatri" <[email protected]>
Newsgroups gmane.comp.db.postgresql.interfaces
Message-ID <[email protected]>
Hi,
In my application I need to check connection status before executing the query. I am doing it using PQstatus. 
Problem is : PQstatus is getting blocked If the system on which database server is running is powered off.
If I shutdown the database using pg_ctl stop or pkill -9 postmaster in that case its returning.

Is there any other way to check the connection status in this case?

Thanks 
Sk
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.