Re: string_to_array with an empty input string
| От | Andrew Dunstan |
|---|---|
| Тема | Re: string_to_array with an empty input string |
| Дата | |
| Msg-id | 4C62E4E1.4000505@dunslane.net обсуждение |
| Ответ на | Re: string_to_array with an empty input string ("David E. Wheeler" <david@kineticode.com>) |
| Ответы |
Re: string_to_array with an empty input string
|
| Список | pgsql-hackers |
On 08/11/2010 01:54 PM, David E. Wheeler wrote: > 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 mustuse generate_subscripts(). for i in array_lower(myarray,1) .. array_upper(myarray,1) loop ... works well cheers andrew
В списке pgsql-hackers по дате отправления: