Re: REVIEW: WIP: plpgsql - foreach in

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: REVIEW: WIP: plpgsql - foreach in
Date: 2011-01-29 11:57:16
Message-ID: 20110129115716.GJ30352@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

* Pavel Stehule (pavel(dot)stehule(at)gmail(dot)com) wrote:
> FOR keyword - please, look on thread about my proposal FOR-IN-ARRAY

I did, and I still don't agree w/ using FOREACH.

> I work with FOUND variable, because I like a consistent behave with
> FOR statement. When FOUND is true after cycle, you are sure, so there
> was a minimally one iteration.

Then the documentation around FOUND needs to be updated for FOREACH, and
there's probably other places that need to be changed too.

> > There also appears to be some extra whitespace changes that aren't
> > necessary and a number of places where you don't follow the indentation
> > conventions (eg: variable definitions in exec_stmt_foreach_a()).
>
> I am really not sure about correct indentation of variables :(, if you
> know a correct number of spaces, please, fix it.

It's not a matter of a 'correct number of space'- make it the same as
what it is in the rest of the code... The gist of it is to make the
variable names all line up (with maximum use of tabs at 4-spaces per
tab, of course):

int my_var;
char *my_string;
double my_double;

etc, etc.

> I'll try to redesign main cycle.

Thanks,

Stephen

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2011-01-29 11:58:45 Re: REVIEW: WIP: plpgsql - foreach in
Previous Message Stephen Frost 2011-01-29 11:50:07 Re: REVIEW: WIP: plpgsql - foreach in