Re: number of elements in a multidimensional array

Поиск
Список
Период
Сортировка
От SunWuKung
Тема Re: number of elements in a multidimensional array
Дата
Msg-id 1157107350.264541.114260@p79g2000cwp.googlegroups.com
обсуждение исходный текст
Ответ на number of elements in a multidimensional array  ("SunWuKung" <Balazs.Klein@t-online.hu>)
Список pgsql-general
SunWuKung wrote:
> >From this array how could I get back the fact that this array consists
> of a two dimensional array with X elements?
>
> Select array_dims('{{1,4,10,11},{1,5,4,5}}'::text [])
>
> I would like to get back the number 4 here?
>
> Thanks for the help.
> Balázs

This is what I came up with finally, not very elegant but seems to do
the job:
Select substring(array_dims('{{1,4,10,11},{1,5,4,5}}'::text []) from
'([0-9]*)]$')


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

Предыдущее
От: nhrcommu@rochester.rr.com
Дата:
Сообщение: Training (from Thought provoking...)
Следующее
От: "Dan"
Дата:
Сообщение: Create user or role from inside a function?