Re: final patch - plpgsql: for-in-array

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Pavel Stehule <pavel.stehule@gmail.com>
Cc: Robert Haas <robertmhaas@gmail.com>, Merlin Moncure <mmoncure@gmail.com>, Jaime Casanova <jaime@2ndquadrant.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2010-11-18T19:24:43Z
Lists: pgsql-hackers
Pavel Stehule <pavel.stehule@gmail.com> writes:
> this note was a different -only  a few people use FOR IN SELECT UNNEST
> for iteration over array. So from Robert's question (what is important
> for current code?) perspective the more significant is access to
> individual fields via subscripts. For example:

> for i in 1..10000 loop
>   s := s + A[i];
> end loop

> is slow, when high limit of array is some bigger number > 1000.

True, but inventing new FOR syntax isn't going to help people who are
used to doing that.

			regards, tom lane