From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> |
Cc: | PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: proposal: plpgsql - iteration over fields of rec or row variable |
Date: | 2010-11-08 18:52:11 |
Message-ID: | 27600.1289242331@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> writes:
> FOR varname OVER [row | rec variable]
> LOOP
> {{body}}
> END LOOP
> this syntax isn't final. The real type of control variable is
> specified in runtime and can be changed between iterations.
If you don't know the type or even the name of the field that varname
currently represents, how is the loop body going to do anything useful?
> This variable should be
> writeable - so we are able to change any field of record.
And that is just plain horrid. The loop variable is a separate
variable, not a modifiable alias for a field, in every existing form
of plpgsql loop.
The idea of multiple instances of the loop body code seems like a mess
anyway. I think this is basically hacking plpgsql beyond recognition
to solve problems that are better solved in plperl or pltcl.
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Bernd Helmle | 2010-11-08 18:55:38 | Re: How can we tell how far behind the standby is? |
Previous Message | Tom Lane | 2010-11-08 18:36:26 | Re: How to share the result data of separated plan |