I'm modifying the function Datum create_vlabel(PG_FUNCTION_ARGS)
, within Apache AGE.
But sometimes it's needed that one of the arguments to this function be NULL
, and there's a check to that, like this:
if (!PG_ARGISNULL(2)) { ... }
The thing is, other functions need to call create_vlabel
with the DirectFunctionCall
command, but I can't figure out how to pass a NULL
value through this command.
Everything I tried either broke the system or was not recognized as a proper NULL
by the if
clause mentioned above.
Here's everything I tried that did not work:
DirectFunctionCall1(create_vlabel, NULL)
DirectFunctionCall1(create_vlabel, CStringGetDatum("NULL"))
DirectFunctionCall1(create_vlabel, CStringGetDatum(""))
DirectFunctionCall1(create_vlabel, CStringGetDatum(NULL))
DirectFunctionCall1(create_vlabel, PointerGetDatum(NULL))
So is there a proper way of sending a NULL
argument through a DirectFunctionCall
?