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

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

From: "David E(dot) Wheeler" <david(at)kineticode(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Proposal: plpgsql - "for in array" statement
Date: 2010-09-28 16:16:59
Message-ID: FB62A97E-9165-44F5-B292-9C4A4BAFC854@kineticode.com (view raw or flat)
Thread:
Lists: pgsql-hackers
On Sep 28, 2010, at 7:41 AM, Robert Haas wrote:

>> I don't have any opinion about whether the functionality proposed here
>> is worth the trouble, but I do have an opinion about that syntax: it's
>> an awful choice.
> 
> I agree, on both points.
> 
> It's nice to try to reduce the excess verbosity that is IMHO the
> biggest usability issue with PL/pgsql, but I can't help wondering
> whether we're trying to dam the Nile with chicken wire.

I would really like to have this functionality. Iterating over arrays is something I do in PL/pgSQL a *lot*.

I see two ways to handle syntax:

1. A new keyword. Some options:
   + FOREACH (too close to FOR?)
   + ITERATE (ew)

2. Require the subscripts() function as syntax.

Thoughts?

Best,

David


In response to

pgsql-hackers by date

Next:From: Tom LaneDate: 2010-09-28 16:18:59
Subject: Re: trailing whitespace in psql table output
Previous:From: Gurjeet SinghDate: 2010-09-28 16:16:11
Subject: Re: security label support, revised

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