Re: final patch - plpgsql: for-in-array - Mailing list pgsql-hackers

From Jaime Casanova
Subject Re: final patch - plpgsql: for-in-array
Date
Msg-id AANLkTikWAJ0mie2sHSxLBYkx7u21=X1cj9wb1zXe6zyr@mail.gmail.com
Whole thread Raw
In response to final patch - plpgsql: for-in-array  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: final patch - plpgsql: for-in-array
Re: final patch - plpgsql: for-in-array
List pgsql-hackers
On Thu, Sep 30, 2010 at 7:46 AM, Pavel Stehule <pavel.stehule@gmail.com> wrote:
> Hello
>
> this patch implement a new iteration construct - iteration over an
> array. The sense of this new iteration is:
>  * a simple and cleaner syntax

i will start the review of this one... but before that sorry for
suggesting this a bit later but about using UNNEST as part of the
sintax?

FOR var IN UNNEST array_expr LOOP
END LOOP

i like this because:
1) is cleaner when array_expr is ARRAY[1,2,3]
2) is not legal now to use the unnest() function without a SELECT in
the context of a FOR loop (or am i missing something?)
3) the unnest() function does the same so seems intuitive what a
FOR-IN-UNNEST do

what i don't know if is this syntax could co-exist with the unnest() function?

--
Jaime Casanova         www.2ndQuadrant.com
Professional PostgreSQL: Soporte y capacitación de PostgreSQL


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: We need to log aborted autovacuums
Next
From: Robert Haas
Date:
Subject: Re: Label switcher function