Re: Timeout Value on network error

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: Timeout Value on network error
Дата
Msg-id 20061105020439.GA10274@winnie.fuhr.org
обсуждение исходный текст
Ответ на Timeout Value on network error  (ecolgan@shiftwatch.com)
Список pgsql-general
On Mon, Oct 30, 2006 at 11:46:01AM -0800, ecolgan@shiftwatch.com wrote:
> We're using a remote Postgres server to view video data.  It works
> well, but we're having a hard time making our app robust when the
> network fails.  For example, PQexec does not return consistently when
> the cable is disconnected.

Network connections use TCP, which was designed to be robust over
unreliable networks.  A TCP connection isn't supposed to fail right
away in the face of network problems like disconnected cables;
instead, TCP retransmits packets with the hope that connectivity
will soon be re-established.

> Is there a timeout value that we can configure, so all PQ* functions
> return consistently?

You could use asynchronous command processing with poll() or select().

http://www.postgresql.org/docs/8.1/interactive/libpq-async.html

--
Michael Fuhr

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

Предыдущее
От: Michael Glaesemann
Дата:
Сообщение: Re: How to get joins to work
Следующее
От: Russell Smith
Дата:
Сообщение: ERROR: tuple concurrently updated