Re: [GENERAL] opened connection

2012-10-01 Thread Tom Lane
Scott Marlowe writes: > 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 > le

Re: [GENERAL] opened connection

2012-10-01 Thread Jasen Betts
On 2012-10-01, Levente Kovacs wrote: > On Sun, 30 Sep 2012 20:24:47 -0700 > Darren Duncan wrote: > > >> Unless you have very unique needs, keeping an open connection for >> days is just wrong anyway; if its for the sake of some user GUI or >> shell, there probably should be safeguards there to en

Re: [GENERAL] opened connection

2012-09-30 Thread Levente Kovacs
On Sun, 30 Sep 2012 20:24:47 -0700 Darren Duncan wrote: > Unless you have very unique needs, keeping an open connection for > days is just wrong anyway; if its for the sake of some user GUI or > shell, there probably should be safeguards there to encourage users > to not keep long-running transa

Re: [GENERAL] opened connection

2012-09-30 Thread Scott Marlowe
On Sun, Sep 30, 2012 at 5:41 PM, Nathan Wagner 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

Re: [GENERAL] opened connection

2012-09-30 Thread Darren Duncan
I think a general best practice is to keep a database connection open for as short a time as possible, where that doesn't adversely impact your performance; so, for example, close it if you don't expect to be using it for the next few minutes, and then reopen it. Open connections tie up resourc

Re: [GENERAL] opened connection

2012-09-30 Thread Nathan Wagner
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,