Re: using arrays as variable, not as field

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: using arrays as variable, not as field
Дата
Msg-id 24160.1048179419@sss.pgh.pa.us
обсуждение исходный текст
Ответ на using arrays as variable, not as field  ("Fernando Papa" <fpapa@claxson.com>)
Список pgsql-general
"Fernando Papa" <fpapa@claxson.com> writes:
> These doc say you can use array_dims to get the dimension of an array.
> But when I try to do some this
> select array_dims('{1,2,3,4,5}');
> I get this message:
> ERROR:  Cannot accept a constant of type ANYARRAY

That's not an array, it's just an untyped string.  This works:

regression=# select array_dims('{1,2,3,4,5}'::int[]);
 array_dims
------------
 [1:5]
(1 row)


            regards, tom lane

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