Re: Help with Array Function in C language... - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Help with Array Function in C language...
Date
Msg-id 29449.1131405418@sss.pgh.pa.us
Whole thread Raw
In response to Help with Array Function in C language...  ("Cristian Prieto" <cristian@clickdiario.com>)
Responses Re: Help with Array Function in C language...  ("Cristian Prieto" <cristian@clickdiario.com>)
List pgsql-hackers
"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

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: broken comment justification logic in new pgindent
Next
From: "Cristian Prieto"
Date:
Subject: Re: Help with Array Function in C language...