Re: WIP: pl/pgsql cleanup

Поиск
Список
Период
Сортировка
От Neil Conway
Тема Re: WIP: pl/pgsql cleanup
Дата
Msg-id 1106280288.22946.274.camel@localhost.localdomain
обсуждение исходный текст
Ответ на Re: WIP: pl/pgsql cleanup  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-patches
On Thu, 2005-01-20 at 07:57 -0500, Tom Lane wrote:
> Not sure, but it seems like at least as straightforward a translation
> as the other way.  More to the point, it makes clear the difference
> between what is meant to be a long-lived data structure and what isn't.

The latter point is sound, I think -- making that distinction clear
would be nice.

One problem is that this prevents easily using List in pl_comp.c and
gram.y, which is a shame. One solution would be to switch the
CurrentMemoryContext to the function's memory context, and provide a
macro to allocate short-lived memory that can be thrown away at the end
of do_compile(). Alternatively, we could provide some means to allow the
caller of the List API functions to specify the context in which list.c
allocations should be performed.

> Why not?  You'd need to keep the context-to-use in a static variable,
> but that's no great difficulty considering that plpgsql function
> parsing needn't be re-entrant.

Yeah, that's fair -- there's already a plpgsql_curr_compile variable, so
we needn't even add another.

-Neil



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

Предыдущее
От: Euler Taveira de Oliveira
Дата:
Сообщение: Re: uptime function to postmaster
Следующее
От: Stephen Frost
Дата:
Сообщение: Merge pg_shadow && pg_group -- UNTESTED