Re: Transaction-lifespan memory leak with plpgsql DO blocks - Mailing list pgsql-hackers

From Dilip kumar
Subject Re: Transaction-lifespan memory leak with plpgsql DO blocks
Date
Msg-id 4205E661176A124FAF891E0A6BA9135265925877@SZXEML507-MBS.china.huawei.com
Whole thread Raw
In response to Re: Transaction-lifespan memory leak with plpgsql DO blocks  (David Johnston <polobo@yahoo.com>)
List pgsql-hackers
On 13 November 2013 03:17 David Johnston wrote,

>
> Having had this same thought WRT the "FOR UPDATE in LOOP" bug posting
> the lack of a listing of outstanding bugs does leave some gaps.  I
> would imagine people would appreciate something like:
>
> Frequency: Rare
> Severity: Low
> Fix Complexity: Moderate
> Work Around: Easy - create an actual function; create some form of loop
> Status: Confirmed - Awaiting Volunteers to Fix

This problem is fixed as explained below..

1. Created own simple_eval_estate for every Do block in plpgsql_inline_handler and Freed it after the execution is
finished.
2. While executing the simple expression if func->simple_eval_estate is not null (means its Do block) then use this
otherwiseuse globle one. 

Patch is attached in the mail.

Please let me know whether this approach is fine or not ?


Regards,
Dilip




Attachment

pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Remove use of obsolescent Autoconf macros
Next
From: Peter Geoghegan
Date:
Subject: Re: Improvement of pg_stat_statement usage about buffer hit ratio