Re: [HACKERS] Help with Array Function in C language... - Mailing list pgsql-general

From Cristian Prieto
Subject Re: [HACKERS] Help with Array Function in C language...
Date
Msg-id 00a801c5e3f1$dea5f9d0$6500a8c0@gt.ClickDiario.local
Whole thread Raw
In response to Re: [HACKERS] Help with Array Function in C language...  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Thanks a lot, but I still getting an error message like this:
ERROR: cache lookup failed for type 0

What is wrong?

-----Original Message-----
From: pgsql-hackers-owner@postgresql.org
[mailto:pgsql-hackers-owner@postgresql.org] On Behalf Of Tom Lane
Sent: Lunes, 07 de Noviembre de 2005 05:17 p.m.
To: Cristian Prieto
Cc: pgsql-general@postgresql.org; pgsql-hackers@postgresql.org
Subject: Re: [HACKERS] Help with Array Function in C language...

"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

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to majordomo@postgresql.org so that your
       message can get through to the mailing list cleanly


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] Help with Array Function in C language...
Next
From: "Bob Powell"
Date:
Subject: odbc in postgresql and php