Re: Single-argument variant for array_length and friends?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Single-argument variant for array_length and friends?
Дата
Msg-id 1401.1363838478@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Single-argument variant for array_length and friends?  (Brendan Jurd <direvus@gmail.com>)
Ответы Re: Single-argument variant for array_length and friends?  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-hackers
Brendan Jurd <direvus@gmail.com> writes:
> While I was working on my empty array patch I was frequently irritated
> by the absence of an array_length(anyarray).  The same goes for
> array_upper and array_lower.  Most of the time when I work with
> arrays, they are 1-D, and it's inelegant to having to specify which
> dimension I mean when there is only one to choose from.

> The question I have (and would appreciate your input on) is how such
> single-argument variants should behave when operating on an array with
> multiple dimensions?

I'm not entirely convinced that this is a good idea, but if we're going
to allow it I would argue that "array_length(a)" should be defined as
"array_length(a, 1)".  The other possibilities are too complicated to
explain in as few words.
        regards, tom lane



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: find libxml2 using pkg-config
Следующее
От: Craig Ringer
Дата:
Сообщение: Re: Trust intermediate CA for client certificates