Re: Fwd: Postgresql - Mailing list pgsql-admin

From Tom Lane
Subject Re: Fwd: Postgresql
Date
Msg-id 19365.1044287403@sss.pgh.pa.us
Whole thread Raw
In response to Re: Fwd: Postgresql  (Gary Stainburn <gary.stainburn@ringways.co.uk>)
List pgsql-admin
Gary Stainburn <gary.stainburn@ringways.co.uk> writes:
> How does Postgresql handle this?  I would hope that it would notice the loss
> of the IP connection and close the link gracefully, and not just leave the
> connectino dangling.

The backend runs the connection with TCP_KEEPALIVE set.  The kernel
should recognize the loss of connectivity after awhile ("awhile" means
an hour or more if your kernel does this in an RFC-compliant fashion)
and inform the backend, which will roll back any open transaction and
then shut down.

If connectivity was lost while active data transfer was going on,
it will probably only take a few minutes for the kernel to declare
connection loss.  But if you were sitting idle, nothing will happen
until the kernel issues a KEEPALIVE probe, which it shouldn't do very
often.

            regards, tom lane

pgsql-admin by date:

Previous
From: Tom Lane
Date:
Subject: Re: Database access problem : SOS
Next
From: Robert Treat
Date:
Subject: Re: Question about backup/restore