Re: Lack of Sanity Checking in file 'pctcl.c' for PostgreSQL 9.4.x

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Lack of Sanity Checking in file 'pctcl.c' for PostgreSQL 9.4.x
Дата
Msg-id CAB7nPqTSwmSeEFAGpWMbq5qkRXfDKm-pcPqPe3x_Xj+=RG9kEQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Lack of Sanity Checking in file 'pctcl.c' for PostgreSQL 9.4.x  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Ответы Re: Lack of Sanity Checking in file 'pctcl.c' for PostgreSQL 9.4.x  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Re: Lack of Sanity Checking in file 'pctcl.c' for PostgreSQL 9.4.x  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Список pgsql-bugs
On Sun, Jul 19, 2015 at 5:19 AM, Alvaro Herrera
<alvherre@2ndquadrant.com> wrote:
> Alvaro Herrera wrote:
>
>> > Now, perhaps we could do more efforts with prodesc as well, see for
>> > example compile_pltcl_function for pltcl and similarly for plperl.
>> > Thoughts?
>>
>> Right.  It would simplify the code: create a memory context child of
>> TopTransactionContext, then compile the function, and if successful,
>> then MemoryContextSetParent to some longer-lived context.  When the
>> function is invalidated, it's sufficient to delete the context and
>> create a new one.  Creating the context as child of
>> TopTransactionContext allows you to avoid an explicit
>> MemoryContextDelete() in the elog(ERROR) cases while compiling.
>
> With some additional effort, we could get rid of perm_fmgr_info, at
> least in pltcl.  (That hack was introduced in a3ed622b63b and
> 7748e9e7e5a back in 2001 and we never actually fixed it ...)

Yes it seems so, even for plperl and plpython there seem to be some
room for improvement at quick glance... This looks like a master-only
change to me though (and I am sure we are on the same page). For
back-branches something like the previous patch is definitely safer.
--
Michael

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

Предыдущее
От: Michael Bommarito
Дата:
Сообщение: Re: BUG #13490: Segmentation fault on pg_stat_activity
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: Lack of Sanity Checking in file 'pctcl.c' for PostgreSQL 9.4.x