Re: why declare arg as a array in FunctionCallInfoData structure - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: why declare arg as a array in FunctionCallInfoData structure
Date
Msg-id 162867790902020039x711f55fbyc665334c885115ae@mail.gmail.com
Whole thread Raw
In response to why declare arg as a array in FunctionCallInfoData structure  ("Tao Ma" <feng_eden@163.com>)
List 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 by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: why declare arg as a array in FunctionCallInfoData structure
Next
From: Simon Riggs
Date:
Subject: Re: Controlling hot standby