"Cristian Prieto" <cristian@clickdiario.com> writes:
> Datum
> test_array(PG_FUNCTION_ARGS)
> {
> ArrayType *v = PG_GETARG_ARRAYTYPE_P(1);
> Datum element;
> Oid array_type = get_array_type(v);
I think you want get_element_type, instead. And you definitely ought to
be checking for a failure result (zero).
regards, tom lane