Re: string_to_array with an empty input string

Поиск
Список
Период
Сортировка
От David E. Wheeler
Тема Re: string_to_array with an empty input string
Дата
Msg-id 12434A65-2A0C-4680-B968-513BB96E9E10@kineticode.com
обсуждение исходный текст
Ответ на Re: string_to_array with an empty input string  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: string_to_array with an empty input string
Список pgsql-hackers
On Aug 11, 2010, at 10:53 AM, Robert Haas wrote:

>> Iterating through an array with plpgsql, for example, is more clunky
>> than it should be.
>
> Really?
>
> FOR var IN SELECT UNNEST(arr) LOOP ... END LOOP
>
> I mean, doing everything is sort of clunky in PL/pgsql, but this
> doesn't seem particularly bad as PL/pgsql idioms go.

That tends to over-flatten if you have nested arrays and just want to iterate over the top level. In that case you must
usegenerate_subscripts(). 

Best,

David



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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: string_to_array with an empty input string
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: string_to_array with an empty input string