Re: [HACKERS] Help with Array Function in C language...

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Cristian Prieto" <cristian(at)clickdiario(dot)com>
Cc: pgsql-general(at)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [HACKERS] Help with Array Function in C language...
Date: 2005-11-07 23:16:58
Message-ID: 29449.1131405418@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

"Cristian Prieto" <cristian(at)clickdiario(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Cristian Prieto 2005-11-07 23:20:38 Re: [HACKERS] Help with Array Function in C language...
Previous Message Tom Lane 2005-11-07 22:58:04 Re: Perl::DBI and interval syntax

Browse pgsql-hackers by date

  From Date Subject
Next Message Cristian Prieto 2005-11-07 23:20:38 Re: [HACKERS] Help with Array Function in C language...
Previous Message Tom Lane 2005-11-07 23:09:41 Re: broken comment justification logic in new pgindent