Re: Proposal: plpgsql - "for in array" statement - Mailing list pgsql-hackers

From Peter Geoghegan
Subject Re: Proposal: plpgsql - "for in array" statement
Date
Msg-id AANLkTinwKnPyM9YqZukNPah7Ns3GfXQ66_k=9tPFC645@mail.gmail.com
Whole thread Raw
In response to Re: Proposal: plpgsql - "for in array" statement  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-hackers
> 2010/9/28 Itagaki Takahiro <itagaki.takahiro@gmail.com>:
>> On Tue, Sep 28, 2010 at 3:24 PM, Pavel Stehule <pavel.stehule@gmail.com> wrote:
>>> I looked on some constructs that helps with iteration over array in
>>> plpgsql. I propose a following syntax:
>>>
>>> FOR var IN [array variable | array expression]
>>
>> What is the benefits compared with
>> FOR ... IN SELECT unnest(array) or generate_subscripts(array) ?
>>
>
> the speed
>

Not to mention that it's far more aesthetically pleasing, and makes
the statement immediately understandable to people unfamiliar with the
plpgsql idioms you describe.

-- 
Regards,
Peter Geoghegan


pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: security label support, revised
Next
From: Robert Haas
Date:
Subject: Re: security label support, revised