Re: array_length(anyarray)

Поиск
Список
Период
Сортировка
От Marko Tiikkaja
Тема Re: array_length(anyarray)
Дата
Msg-id 52B2115F.8030206@joh.to
обсуждение исходный текст
Ответ на Re: array_length(anyarray)  (Andrew Dunstan <andrew@dunslane.net>)
Ответы Re: array_length(anyarray)
Re: array_length(anyarray)
Список pgsql-hackers
On 2013-12-18 22:13, Andrew Dunstan wrote:
> On 12/18/2013 03:27 PM, Marko Tiikkaja wrote:
>> Attached is a patch to add support for array_length(anyarray), which
>> only works for one-dimensional arrays, returns 0 for empty arrays and
>> complains if the array's lower bound isn't 1.  In other words, does
>> the right thing when used with the arrays people use 99% of the time.
>
> Why the heck would it complain if the lower bound isn't 1?

Because then you're free to assume that the first element is [1] and the 
last one is [array_length()].  Which is what 99% of the code using 
array_length(anyarray, int) does anyway.


Regards,
Marko Tiikkaja



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

Предыдущее
От: Josh Berkus
Дата:
Сообщение: Re: [PATCH] SQL assertions prototype
Следующее
От: Marko Tiikkaja
Дата:
Сообщение: Re: array_length(anyarray)