Isn't it not possible to check that the connectivity is broken in advance and if so, wait on the socket would not be required.
If we have to timeout (even 1-2 seconds), it will be pretty long for the highly available applications. Is there any way to check the health of the interface? regards, Niranjan -----Original Message----- From: ext Tom Lane [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 16, 2008 8:03 PM To: Gregory Stark Cc: K, Niranjan (NSN - IN/Bangalore); pgsql-bugs@postgresql.org Subject: Re: [BUGS] Psql or test application hangs when interface is down for the DB server Gregory Stark <[EMAIL PROTECTED]> writes: > "K, Niranjan (NSN - IN/Bangalore)" <[EMAIL PROTECTED]> writes: >> Is there any other workaround or alternative so that the situation >> about the interface is down is known and based on that the 'PQexec' >> does not get blocked for ~15 minutes. > Absent threads I think you have to use alarm() and a SIGALRM signal handler. On most modern platforms you can adjust the TCP timeouts for the connection. There's no explicit support for that in libpq, but you can just get the socket FD from it and do setsockopt(). regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs