Re: Transaction-lifespan memory leak with plpgsql DO blocks

Поиск
Список
Период
Сортировка
От Dilip kumar
Тема Re: Transaction-lifespan memory leak with plpgsql DO blocks
Дата
Msg-id 4205E661176A124FAF891E0A6BA9135265925877@SZXEML507-MBS.china.huawei.com
обсуждение исходный текст
Ответ на Re: Transaction-lifespan memory leak with plpgsql DO blocks  (David Johnston <polobo@yahoo.com>)
Список 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




Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Remove use of obsolescent Autoconf macros
Следующее
От: Peter Geoghegan
Дата:
Сообщение: Re: Improvement of pg_stat_statement usage about buffer hit ratio