Force termination of an idle connection

Поиск
Список
Период
Сортировка
От miller_2555
Тема Force termination of an idle connection
Дата
Msg-id 25375135.post@talk.nabble.com
обсуждение исходный текст
Список pgsql-general
Hi -

I have a multi-threaded application that spawns child processes, inserts
information into the database, then disconnects. For whatever reason, some
of the children do not disconnect and the database is left with idle
connections (that eventually max out over time). How can I either force the
child thread to terminate the connection or have the database force a
disconnect after a specified time of inactivity? This is not an embedded C
application, and I believe the `statement_timeout` option only applies to
the database latency for each statement (though please correct me if I am
wrong). Ideally, the solution would be the logical equivalent of either
`terminate after n (milli)seconds of inactivity` or, a less desirable, `keep
this connection open for at most n seconds/minutes.` I'd prefer to avoid
polling the pg_stat_activity table to kill pids

Thanks!
--
View this message in context: http://www.nabble.com/Force-termination-of-an-idle-connection-tp25375135p25375135.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


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

Предыдущее
От: Chris
Дата:
Сообщение: Re: pg_dump exists without any message when running from windows task scheduler
Следующее
От: "Peter Headland"
Дата:
Сообщение: COPY command character set