Re: Using unnest

Поиск
Список
Период
Сортировка
От Thomas Kellerer
Тема Re: Using unnest
Дата
Msg-id h4frds$2g1$1@ger.gmane.org
обсуждение исходный текст
Ответ на Re: Using unnest  (Jeff Davis <pgsql@j-davis.com>)
Ответы Re: Using unnest
Список pgsql-general
Jeff Davis wrote on 25.07.2009 22:44:
> It's generally hard to work with values of type anyarray. You have to
> cast them to text and then to a normal array type.
>
> For example:
>
>   select unnest(histogram_bounds::text::oid[]) from pg_stats where
>          tablename='pg_amop' and attname='amopopr';

Great, thanks

I tried casting the column to text[] (because it contains elements of type text) but I didn't think
of doing a two way cast.

Do I understand this correctly that by casting it first to text, I effectively create a new array
the same way I create one, when I supply a literal like '{1,2,3}'::text[]

Thomas



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

Предыдущее
От: Jeff Davis
Дата:
Сообщение: Re: Using unnest
Следующее
От: "Daniel Verite"
Дата:
Сообщение: Re: where is pg_resetxlog ?