Re: opened connection

From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: Nathan Wagner <nw(at)hydaspes(dot)if(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: opened connection
Date: 2012-10-01 05:17:48
Message-ID: CAOR=d=1h+bCL9o_DOzv3GDpzjJezwvEbTEYR503vcOmtg5kUSg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sun, Sep 30, 2012 at 5:41 PM, Nathan Wagner <nw(at)hydaspes(dot)if(dot)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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Levente Kovacs 2012-10-01 06:59:12 Re: opened connection
Previous Message Rajesh Kumar Mallah 2012-10-01 04:42:10 Re: enforcing transaction mode for read-write queries.