I would like to create a function
CREATE FUNCTION func(a INT, b DOUBLE PRECISION = 1e-9, c DOUBLE PRECISION = 1e-9)
RETURNS BOOLEAN
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE STRICT;
How can one determine which arguments were actually passed to the C api?
Can one just use a check like
PG_GETARG_DATUM(1) != NULL
to check if the argument 1 was passed? I am writing the code for postgres >= 9.1
PG_ARGISNULL(n), PG_NARGS()
b
andc
will always be actually passed, either with default or explicit values. PG_NARGS is only useful if several Postgres functions share the same C code