Single-argument variant for array_length and friends?

Поиск
Список
Период
Сортировка
От Brendan Jurd
Тема Single-argument variant for array_length and friends?
Дата
Msg-id CADxJZo0QaLybPfdMHGbG0TVwCc8xUcRzxJ7_hjrDQ+=kKjR8bg@mail.gmail.com
обсуждение исходный текст
Ответы Re: Single-argument variant for array_length and friends?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Hi hackers,

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 see a few different options:

a) throw an error like "Dimension argument is required for multiple
dimension arrays"

b) assume the user means the final (innermost) dimension

c) assume the user means the first (outermost) dimension

My inclination is towards (c) but I don't use multi-D arrays in
postgres in the field.  Opinions?

Cheers,
BJ



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

Предыдущее
От: Noah Misch
Дата:
Сообщение: Re: find libxml2 using pkg-config
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: Ignore invalid indexes in pg_dump