Re: "select ('{}'::text[])[1]" returns NULL -- is it correct?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Nikolay Samokhvalov" <nikolay(at)samokhvalov(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: "select ('{}'::text[])[1]" returns NULL -- is it correct?
Date: 2007-04-10 13:55:34
Message-ID: 25231.1176213334@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Nikolay Samokhvalov" <nikolay(at)samokhvalov(dot)com> writes:
> I remember several cases when people (e.g. me :-) ) were spending some
> time trying to find an error in some pl/pgsql function and the reason
> lied in incorrect work with arrays (i.e. messages like "index is out
> of bounds" and "index cannot be negative number" would help, surely).

Well, if indexes *couldn't* be negative numbers then that might be
helpful, but they can.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2007-04-10 14:14:50 Idle idea for a feature
Previous Message Peter Eisentraut 2007-04-10 12:40:37 \da doesn't show result type