Sample Header Ad - 728x90

What arguments get passed with PG_FUNCTION_ARGS (with the V1 convention)?

0 votes
1 answer
498 views
PostgreSQL Documents all their C functions with a "V1" interface, but they don't actually show what they get,
PG_FUNCTION_INFO_V1(add_one);

Datum
add_one(PG_FUNCTION_ARGS)
{
    int32   arg = PG_GETARG_INT32(0);

    PG_RETURN_INT32(arg + 1);
}
In the above what does PG_FUNCTION_ARGS declare the function to accept? Many V1 function seem to have a fcinfo magically show up in the definition, I'm guessing it's brought in here but what is it and does anything else get brought in with this macro?
Asked by Evan Carroll (65502 rep)
Nov 3, 2021, 02:31 AM
Last activity: Nov 3, 2021, 02:35 AM