Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-hackers by date

Next:From: Robert HaasDate: 2010-09-28 13:22:05
Subject: Re: security label support, revised
Previous:From: Peter EisentrautDate: 2010-09-28 12:03:06
Subject: Re: security label support, revised

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group