Re: BUG #5302: WIN1252 encoding causes server memory leak

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Florian Nigsch" <contact(at)flo(dot)nigsch(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5302: WIN1252 encoding causes server memory leak
Date: 2010-01-30 20:13:02
Message-ID: 7612.1264882382@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"Florian Nigsch" <contact(at)flo(dot)nigsch(dot)com> writes:
> The following rapidly consumes server memory:

> -- Causes leak:
> SET client_encoding TO 'WIN1252';

> BEGIN;
> CREATE TEMP TABLE t1(pk INT PRIMARY KEY);

> -- Repeat 1000 times
> DECLARE mycur CURSOR WITH HOLD FOR SELECT * FROM t1;
> FETCH 100 IN mycur;
> SAVEPOINT mysp;
> CLOSE mycur;
> RELEASE mysp;
> -- End repeat

I've applied a patch for this, but I have to say that using a SAVEPOINT
around a CLOSE is an awfully expensive use of a savepoint. You might
want to nag the psqlodbc people to see if they can't avoid that.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Steve White 2010-01-31 12:20:25 Re: BUG #5272: PL/Python SELECT: return composite fields as dict, not str
Previous Message Craig Ringer 2010-01-30 05:43:52 Re: BUG #5303: Upgrade failure due to sever.key permissions