Re: updated patch for foreach stmt

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>, Takahiro Itagaki <itagaki(dot)takahiro(at)gmail(dot)com>
Subject: Re: updated patch for foreach stmt
Date: 2011-02-08 20:26:24
Message-ID: 20110208202623.GQ4116@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Greetings,

* Pavel Stehule (pavel(dot)stehule(at)gmail(dot)com) wrote:
> I resend a patch with last update of this patch

Alright, so, like I said, I really like this feature and would like to
see it included. To that end, I've done perhaps a bit more than a
review of the patch. Pavel, if you could go over the changes I've made
and review them and let me know if you see any problems, I'd appreciate
it. I've tried to get it ready for a committer as much as I can without
being one. :)

I moved the array iteration over into arrayfuncs.c, cleaned it up quite
a bit, cleaned up the pl/pgsql foreach function, improved the PL/PgSQL
documentation to understand FOREACH as another top-level command, added
comments all over the place, etc.

Passes all regressions too.

commit 19deaf69a4dabfa4a223a6dcd36570866ad0bd3c
Author: Stephen Frost <sfrost(at)snowman(dot)net>
Date: Tue Feb 8 15:15:48 2011 -0500

PL/PgSQL FOREACH cleanup

Define and rename element OID to be more consistant, ensure
that the right name gets returned in error messages, and fix
regression output to match new error message (grammar cleanup).

commit f88fd2ab5419f9a2784677038b3fb01053c69163
Merge: f191af1 8c6e3ad
Author: Stephen Frost <sfrost(at)snowman(dot)net>
Date: Tue Feb 8 14:28:18 2011 -0500

Merge branch 'master' of git://git.postgresql.org/git/postgresql into plpgsql_foreach

commit f191af16f9d3e5ae0072e61c1b58713040cc8d64
Author: Stephen Frost <sfrost(at)snowman(dot)net>
Date: Tue Feb 8 14:27:05 2011 -0500

PL/PgSQL FOREACH Minor Whitespace Cleanup

commit 612cf5485f202a49aec70cf32f74d19d0d130b6b
Author: Stephen Frost <sfrost(at)snowman(dot)net>
Date: Tue Feb 8 14:06:06 2011 -0500

Improving FOREACH, code and documentation

This patch moves and reworks much of the array iteration code
that FOREACH had been implemented with to be part of arrayfuncs.c
and exported through utils/array.h. It also cleans up the error
handling and set up pieces of the FOREACH handling in pl_exec.c
Lastly, the documentation and comments are updated and improved.

commit 89058b79e43311e8f37af16c3fc17b622dc97578
Author: Stephen Frost <sfrost(at)snowman(dot)net>
Date: Sun Feb 6 14:14:04 2011 -0500

Add FOREACH top-level PL/PgSQL command

This patch adds a new top-level PL/PgSQL command called FOREACH which
is intended to be for iterating over multi-value variables. This also
includes the first FOREACH type, an ARRAY iteration capability.

Patch by Pavel Stehule.

Thanks,

Stephen

Attachment Content-Type Size
plpgsql_foreach_20110208.patch text/x-diff 36.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2011-02-08 20:32:12 Re: updated patch for foreach stmt
Previous Message Joshua D. Drake 2011-02-08 20:26:17 Re: Sync Rep for 2011CF1