Re: why declare arg as a array in FunctionCallInfoData structure

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: why declare arg as a array in FunctionCallInfoData structure
Дата
Msg-id 162867790902020039x711f55fbyc665334c885115ae@mail.gmail.com
обсуждение исходный текст
Ответ на why declare arg as a array in FunctionCallInfoData structure  ("Tao Ma" <feng_eden@163.com>)
Список pgsql-hackers
2009/2/2 Tao Ma <feng_eden@163.com>:
> hi,
>
> When I read the postgresql codes, I noticed that the FunctionCallInfoData
> structure(declared in the src/include/fmgr.h) contains two arrays 'arg' and
> 'argnull'.
> Why don't you declare it as a pointer and allocate the memory from heap? It
> saves more momery if 'arg' and 'argnull' declares as pointer type.
>
> Can anyone explain it to me?
>

It based on Datum data type, that store short fixed values directly
(int, float), and you need second array, that carries info about NULL
or NOT NULL. Bigger problem is some non consistency - sometime this is
bool array, and sometime array of char.

Regards
Pavel Stehule


> Thanks in advance.
>
>
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>


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

Предыдущее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: why declare arg as a array in FunctionCallInfoData structure
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: Controlling hot standby