Re: opened connection - Mailing list pgsql-general

From Scott Marlowe
Subject Re: opened connection
Date
Msg-id CAOR=d=1h+bCL9o_DOzv3GDpzjJezwvEbTEYR503vcOmtg5kUSg@mail.gmail.com
Whole thread Raw
In response to Re: opened connection  (Nathan Wagner <nw@hydaspes.if.org>)
Responses Re: opened connection  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On Sun, Sep 30, 2012 at 5:41 PM, Nathan Wagner <nw@hydaspes.if.org> wrote:
> On Sun, Sep 30, 2012 at 06:54:35PM +0200, Levente Kovacs wrote:
>> I've been using PostgreSQL for quite while, but I'd need some direction on
>> how to handle an opened socket to the database in longer periods.
>>
>> I open the connection to my database with PQconnectdb().
>>
>> I access the database, everything is fine. However, if I don't access the
>> database for a long time (measured in days), the connection is broken. I
>> get this error message:
>>
>> SQL action failed: 'FATAL:  terminating connection due to administrator
>> command SSL connection has been closed unexpectedly.
>
> Are you setting keepalives on the connection?  They should be on
> by default, but it's worth checking.  Perhaps they don't
> cooperate with SSL somehow.

I've had problems with ssl connections dying on me.  For slony
replication I had to make sure the connections were NOT ssl or they'd
die and subscriptions would just keep repeating after getting 80%
through and getting a connect error. This was with 8.4 on debian
lenny.


pgsql-general by date:

Previous
From: Rajesh Kumar Mallah
Date:
Subject: Re: enforcing transaction mode for read-write queries.
Next
From: Levente Kovacs
Date:
Subject: Re: opened connection