Kirill Krasnosselov <kirill@digicol.de> writes:
> PG_FUNCTION_INFO_V1(dc_ftx);
> Datum
> dc_ftx(PG_FUNCTION_ARGS)
> { ReturnSetInfo* rsi = (ReturnSetInfo *)fcinfo->resultinfo;
> rsi->isDone = ExprEndResult;
> PG_RETURN_NULL();
> }
This looks like it should work, but you're living dangerously
by not checking that you're being called the way you expect.
You should have something like
if (!fcinfo->resultinfo || !IsA(fcinfo->resultinfo,ReturnSetInfo))
elog(ERROR, ...);
in there before trying to dereference the pointer.
> In my opinion this function call shall returns a empty table,
> but this call does not end.
Try attaching to the backend with a debugger to see what it's doing.
regards, tom lane