Re: [HACKERS] Troubles with array_ref

From: "Cristian Prieto" <cristian(at)clickdiario(dot)com>
To: "'Tom Lane'" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-general(at)postgresql(dot)org>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] Troubles with array_ref
Date: 2005-11-09 15:42:36
Message-ID: 006c01c5e544$3761f2b0$6500a8c0@gt.ClickDiario.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Thanks a lot man!!! You saved my life :P

-----Original Message-----
From: pgsql-general-owner(at)postgresql(dot)org
[mailto:pgsql-general-owner(at)postgresql(dot)org] On Behalf Of Tom Lane
Sent: Martes, 08 de Noviembre de 2005 04:13 p.m.
To: Cristian Prieto
Cc: pgsql-general(at)postgresql(dot)org; pgsql-hackers(at)postgresql(dot)org
Subject: Re: [GENERAL] [HACKERS] Troubles with array_ref

"Cristian Prieto" <cristian(at)clickdiario(dot)com> writes:
> Well, anyway, this is the Stored Function I've been workin on; it simply
> take an array and an integer just to return this item from the array; The
> array could have any kind of elements so I declare it as anyarray (the
> parameter) and anyelement (the return value), please help me, I don't know
> where to get info about it.

You could save yourself a lot of time if you enabled warnings from your
C compiler (eg, -Wall for gcc) and then paid some attention to them.
The last parameter to array_ref is a bool *, not a bool, and I have no
doubt that the backend is crashing while trying to dereference "false".

(Another problem is that the fourth parameter should be -1 not VARSIZE.)

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2005-11-09 15:47:39 Re: clustering by partial indexes
Previous Message Csaba Nagy 2005-11-09 15:36:21 Re: Question on Insert / Update

Browse pgsql-hackers by date

  From Date Subject
Next Message Joel Stevenson 2005-11-09 15:44:01 Re: BUG #2033: Assertion Failure: File: "procarray.c",
Previous Message Tom Lane 2005-11-09 15:42:00 Re: SIGSEGV taken on 8.1 during dump/reload