Re: PL/pgSQL proposal: using list of scalars in assign stmts, fore and fors stmts

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Pavel Stehule" <pavel(dot)stehule(at)hotmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: PL/pgSQL proposal: using list of scalars in assign stmts, fore and fors stmts
Date: 2005-12-22 17:00:24
Message-ID: 23657.1135270824@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Pavel Stehule" <pavel(dot)stehule(at)hotmail(dot)com> writes:
> <for> := FOR <target> IN {SELECT | EXECUTE} ... LOOP
> <target> := {row|record|comma separated list of scalar vars}

This part seems all right to me.

> <assign> := <target2> ':=' <expression>
> <target2> := {row|record|variable|'ROW(' comma separated list of scalar vars
> ')'}

As I already said on -patches, I consider this a bad idea. It's too
error prone (because there's no easy way of seeing what the field order
will be). And it doesn't add anything that you can't do now. I think
a series of "var = rec.field" assignments is a preferable way to do it.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2005-12-22 17:12:04 Re: WAL bypass for INSERT, UPDATE and DELETE?
Previous Message Martijn van Oosterhout 2005-12-22 15:59:16 Re: Unsplitting btree index leaf pages