Re: array_length(anyarray)

Поиск
Список
Период
Сортировка
От Marko Tiikkaja
Тема Re: array_length(anyarray)
Дата
Msg-id 52D9EFE9.20608@joh.to
обсуждение исходный текст
Ответ на Re: array_length(anyarray)  (Marko Tiikkaja <marko@joh.to>)
Ответы Re: array_length(anyarray)  (Pavel Stehule <pavel.stehule@gmail.com>)
Re: array_length(anyarray)  (Dean Rasheed <dean.a.rasheed@gmail.com>)
Список pgsql-hackers
On 1/12/14, 5:53 AM, I wrote:
> On 1/9/14, 2:57 PM, Dean Rasheed wrote:
>> How it should behave for multi-dimensional arrays is less clear, but
>> I'd argue that it should return the total number of elements, i.e.
>> cardinality('{{1,2},{3,4}}'::int[][]) = 4. That would make it
>> consistent with the choices we've already made for unnest() and
>> ordinality:
>>    - cardinality(foo) = (select count(*) from unnest(foo)).
>>    - unnest with ordinality would always result in ordinals in the range
>> [1, cardinality].
>
> Ignoring my proposal, this seems like the most reasonable option.  I'll
> send an updated patch along these lines.

Here's the patch as promised.  Thoughts?


Regards,
Marko Tiikkaja

Вложения

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Minor improvements to sslinfo contrib module
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [PATCH] Make various variables read-only (const)