Connection Timeout ?

Started by Stefan Loidlalmost 25 years ago3 messagesgeneral
Jump to latest
#1Stefan Loidl
Stefan.Loidl@lrz-muenchen.de

Hi,

is there a connection timeout in postgres?
It seems to me that connections that are idle for about a day,
are closed automatically by the corresponding postmaster process
and the process exits.

I'm using Postgres 7.1.2.

Thanks,
Stefan

--
Stefan Loidl Phone: +49 89 289-28882
Leibniz Supercomputing Center Fax: +49 89 2809460
Barer Str. 21 mailto:loidl@lrz.de
80333 Munich, Germany http://www.lrz.de

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Stefan Loidl (#1)
Re: Connection Timeout ?

Stefan Loidl <Stefan.Loidl@lrz-muenchen.de> writes:

is there a connection timeout in postgres?
It seems to me that connections that are idle for about a day,
are closed automatically by the corresponding postmaster process
and the process exits.

No such mechanism in Postgres itself, but perhaps you are seeing the
effects of some timeout in your TCP stack.

(More usually, we get complaints from people who think there *should*
be a timeout ;-))

regards, tom lane

#3Stefan Loidl
Stefan.Loidl@lrz-muenchen.de
In reply to: Stefan Loidl (#1)
Re: Connection Timeout ?

Tom Lane wrote:

Stefan Loidl <Stefan.Loidl@lrz-muenchen.de> writes:

is there a connection timeout in postgres?
It seems to me that connections that are idle for about a day,
are closed automatically by the corresponding postmaster process
and the process exits.

No such mechanism in Postgres itself, but perhaps you are seeing the
effects of some timeout in your TCP stack.

I've just got a connection to a database on the same host and
I'm starting the postmaster without '-i'.
So I don't think the TCP stack is involved in this case?
Any other ideas where the problem could be?

Besides, I'm testing the connection status with PQstatus(),
but it doesn't return CONNECTION_BAD (after the connection has
been closed) until the next query.
Is there a better way to test a connection?

Thanks,
Stefan

--
Stefan Loidl Phone: +49 89 289-28882
Leibniz Supercomputing Center Fax: +49 89 2809460
Barer Str. 21 mailto:loidl@lrz.de
80333 Munich, Germany http://www.lrz.de