Alexey Nalbat <alexey(at)price(dot)ru> writes:
> I digged into sources and supposed that line 61 in fmgr.h might be
> 'struct ReturnSetInfo *resultinfo;' instead of 'struct Node
> *resultinfo;'. But I'm not sure if it is correct.
No, it isn't. fmgr.h is correct as given, because the resultinfo
field might point at various different kinds of Nodes. You need to
do an IsA test and then a cast, instead. See the code in
src/backend/executor/functions.c for an example.
regards, tom lane