Re: C Function Memory Management

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: C Function Memory Management
Дата
Msg-id 10079.1355330654@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: C Function Memory Management  (Martin French <Martin.French@romaxtech.com>)
Ответы Re: C Function Memory Management
Список pgsql-general
Martin French <Martin.French@romaxtech.com> writes:
> So out of curiosity, what would be your approach for data preservation
> cross call?

Usually I'd allocate the space in fcinfo->flinfo->fn_mcxt (which is a
query-lifespan context) and keep a pointer to it in
fcinfo->flinfo->fn_extra (which is a void * field that a C function
can do what it pleases with).  There are plenty of examples in the
Postgres source code.  If you are looking to cache data longer than
one query then it takes more thought.

            regards, tom lane


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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: Columns defined not matching pg_attibute
Следующее
От: Mihai Popa
Дата:
Сообщение: Re: large database