david.hoksza@seznam.cz writes:
> Thanks for answering, it was a good guess, I really didn't mark it,
> but unfortunately it didn't solve my problem. It still falls down,
> when I try to access the argument.
> But it seems strange to me, that converting to Relation is OK:
> Relation index_rel = (Relation) PG_GETARG_POINTER(1);
> and also that comparing to NULL is OK:
> if (index_rel == NULL).
Neither of those prove a thing (except that you don't have a null
pointer). I'd still guess that you don't have the V1 parameter marking
correct, and so what the function thinks it's picking up is garbage
because the backend is not passing the parameters the way the function
expects.
You might try using gdb to see exactly what parameter values the
function thinks it's getting, or print them out to the log before you
use them.
regards, tom lane