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

From Tom Lane
Subject Re: "select ('{}'::text[])[1]" returns NULL -- is it correct?
Date
Msg-id 25231.1176213334@sss.pgh.pa.us
Whole thread Raw
In response to "select ('{}'::text[])[1]" returns NULL -- is it correct?  ("Nikolay Samokhvalov" <samokhvalov@gmail.com>)
Responses Re: "select ('{}'::text[])[1]" returns NULL -- is it correct?  ("Nikolay Samokhvalov" <nikolay@samokhvalov.com>)
List pgsql-hackers
"Nikolay Samokhvalov" <nikolay@samokhvalov.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


pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: \da doesn't show result type
Next
From: Tom Lane
Date:
Subject: Idle idea for a feature