Re: Proposal: plpgsql - "for in array" statement

From: Peter Geoghegan <peter(dot)geoghegan86(at)gmail(dot)com>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: Itagaki Takahiro <itagaki(dot)takahiro(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Proposal: plpgsql - "for in array" statement
Date: 2010-09-28 12:45:30
Message-ID: AANLkTinwKnPyM9YqZukNPah7Ns3GfXQ66_k=9tPFC645@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> 2010/9/28 Itagaki Takahiro <itagaki(dot)takahiro(at)gmail(dot)com>:
>> On Tue, Sep 28, 2010 at 3:24 PM, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2010-09-28 13:22:05 Re: security label support, revised
Previous Message Peter Eisentraut 2010-09-28 12:03:06 Re: security label support, revised