Re: opened connection

From: Jasen Betts <jasen(at)xnet(dot)co(dot)nz>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: opened connection
Date: 2012-10-01 08:35:58
Message-ID: k4bkle$p5l$1@reversiblemaps.ath.cx
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 2012-10-01, Levente Kovacs <leventelist(at)gmail(dot)com> wrote:
> On Sun, 30 Sep 2012 20:24:47 -0700
> Darren Duncan <darren(at)darrenduncan(dot)net> 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 transactions or connections.
>
> Okay. Thanks for the answers. I implemented an alarm for the timeout, and I
> close the connection when it is not needed in certain amount of time.
>
> However, I have an other question.
> Calling PQfinish() on an already closed connection makes my program
> segfault. Is this normal?

Absolutely. Calling PQfinish on any other pointer to unallocated
heap is likely to cause a segfault too. same as calling fclose()
on a closed, (or unopened), FILE*.

--
⚂⚃ 100% natural

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Carrington, Matthew (Produban) 2012-10-01 08:43:21 Re: pg_upgrade: out of memory
Previous Message Mr Dash Four 2012-10-01 08:20:41 Re: strange permission error