Re: REVIEW: WIP: plpgsql - foreach in - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: REVIEW: WIP: plpgsql - foreach in
Date
Msg-id AANLkTim6xPyP3OV9BPK__r49Ky_59-4rp6+7vbrH6bT8@mail.gmail.com
Whole thread Raw
In response to Re: REVIEW: WIP: plpgsql - foreach in  (Stephen Frost <sfrost@snowman.net>)
Responses Re: REVIEW: WIP: plpgsql - foreach in  (Stephen Frost <sfrost@snowman.net>)
List pgsql-hackers
2011/1/29 Stephen Frost <sfrost@snowman.net>:
> * Itagaki Takahiro (itagaki.takahiro@gmail.com) wrote:
>> On Mon, Jan 24, 2011 at 13:05, Stephen Frost <sfrost@snowman.net> wrote:
>> > FOR var in ARRAY array_expression ...
>> >
>> > I like that a lot more than inventing a new top-level keyword,
>>
>> AFAIR, the syntax is not good at an array literal.
>>   FOR var IN ARRAY ARRAY[1,2,5] LOOP ...
>
> I don't really see why that's "not good"?  So you have 'ARRAY' twice..
> So what?  That's better than having a new top-level FOREACH that doesn't
> have any reason to exist except to be different from FOR and to not do
> the same thing..

I don't see a problem too, but we didn't find a compromise with this
syntax, so I left it. It is true, so current implementation of FOR
stmt is really baroque and next argument is a compatibility with
PL/SQL. My idea is so FOR stmt will be a compatible with PL/SQL
original, and FOREACH can be a platform for PostgreSQL specific code.

Regards

Pavel

>
>        Thanks,
>
>                Stephen
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
>
> iEYEARECAAYFAk1D/u8ACgkQrzgMPqB3kij2IwCfZ3W+mGc7LedBdnt9lCa0vYjk
> m6QAn0xh7r6oTs+T47k+EuwZRpU2T0X8
> =ruBa
> -----END PGP SIGNATURE-----
>
>


pgsql-hackers by date:

Previous
From: Stephen Frost
Date:
Subject: Re: REVIEW: WIP: plpgsql - foreach in
Next
From: Alexander Korotkov
Date:
Subject: Re: wildcard search support for pg_trgm