Re: possible memory leak with SRFs

Поиск
Список
Период
Сортировка
От Nikhil Sontakke
Тема Re: possible memory leak with SRFs
Дата
Msg-id u2ua301bfd91005062314hf9f3e13ew4911f08a9a53bcad@mail.gmail.com
обсуждение исходный текст
Ответ на Re: possible memory leak with SRFs  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: possible memory leak with SRFs  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Hi,

>> Can someone please explain why we do not reset the expression context
>> if an SRF is involved during execution?
>
> Consider
>        srf(foo(col))
> where foo returns a pass-by-reference datatype.  Your proposed patch
> would cut the knees out from under argument values that the SRF could
> reasonably expect to still be there on subsequent calls.
>

Yeah this is my basic confusion. But wouldn't the arguments be
evaluated afresh on the subsequent call for this SRF? In that case
freeing up the context of the *last* call should not be an issue I
would think.

And if this is indeed the case we should be using a different longer
lived context and not the ecxt_per_tuple_memory context..

Regards,
Nikhils
--
http://www.enterprisedb.com


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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: including PID or backend ID in relpath of temp rels
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: SQLSTATE for Hot Standby cancellation