Re: updated patch for foreach stmt

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Takahiro Itagaki <itagaki(dot)takahiro(at)gmail(dot)com>
Subject: Re: updated patch for foreach stmt
Date: 2011-02-08 21:04:51
Message-ID: AANLkTikJHhK7+btBhfE-x=JKy-AmTv-2vhjOQH2Q8-qE@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2011/2/8 Stephen Frost <sfrost(at)snowman(dot)net>:
> * Robert Haas (robertmhaas(at)gmail(dot)com) wrote:
>> Amen to that!
>
> Hopefully it helped. :)
>
>> I think the syntax Tom suggested before was FOREACH thingy IN ARRAY
>> arr rather than just FOREACH thingy IN arr.  That's probably a good
>> idea, because it gives us an escape hatch against needing to invent
>> yet another variant of this syntax - the word immediately following IN
>> can be known with confidence to be intended as a keyword rather than
>> as part of the expression.
>
> Alright, alright, *I* don't care that much, though I do feel it's a bit
> excessive.  Updated patch against HEAD attached.

I am thinking so it is good idea. Even I have no plans to expand
plpgsql in next year :), it really opening a doors for later changes.
And it's more secure - we can check if parameter is really array or
some else.

Regards

Pavel Stehule

>
> commit a5d32fa41fbbbd9ace465f62be714366990061d4
> Author: Stephen Frost <sfrost(at)snowman(dot)net>
> Date:   Tue Feb 8 15:57:40 2011 -0500
>
>    PL/PgSQL FOREACH - Add ARRAY keyword
>
>    Add ARRAY as required after IN when using FOREACH, to
>    future-proof against later kinds of FOREACH commands.
>
>        Thanks,
>
>                Stephen
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
>
> iEYEARECAAYFAk1RrtUACgkQrzgMPqB3kigt6gCffjFcE4ddo76ECj+kB+iaM7DV
> c2UAnRDMh1B7r+4ZrnJtIeoRUXJy42+f
> =ZwQa
> -----END PGP SIGNATURE-----
>
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message michel wildcat 2011-02-08 21:07:15 create an extension of postgresql 9 with Visual C++ 2008 express edition
Previous Message Stephen Frost 2011-02-08 21:00:05 Re: updated patch for foreach stmt