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

Поиск
Список
Период
Сортировка
От Nikolay Samokhvalov
Тема Re: "select ('{}'::text[])[1]" returns NULL -- is it correct?
Дата
Msg-id e431ff4c0704100725v7238cd1w840b3d32bf965f31@mail.gmail.com
обсуждение исходный текст
Ответ на Re: "select ('{}'::text[])[1]" returns NULL -- is it correct?  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: "select ('{}'::text[])[1]" returns NULL -- is it correct?  ("Florian G. Pflug" <fgp@phlo.org>)
Список pgsql-hackers
On 4/10/07, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> "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.
>

Ooops :-) OK, my proposal is narrowing to very simple one: what about
triggering WARNINGs when user tries to access nonexistent element of
array?

-- 
Best regards,
Nikolay


В списке pgsql-hackers по дате отправления:

Предыдущее
От: "marcofuics"
Дата:
Сообщение: prepared statements logging
Следующее
От: "Nikolay Samokhvalov"
Дата:
Сообщение: Re: "select ('{}'::text[])[1]" returns NULL -- is it correct?