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

From Tom Lane
Subject Re: PL/pgSQL proposal: using list of scalars in assign stmts, fore and fors stmts
Date
Msg-id 23657.1135270824@sss.pgh.pa.us
Whole thread Raw
In response to PL/pgSQL proposal: using list of scalars in assign stmts, fore and fors stmts  ("Pavel Stehule" <pavel.stehule@hotmail.com>)
List pgsql-hackers
"Pavel Stehule" <pavel.stehule@hotmail.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


pgsql-hackers by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: Unsplitting btree index leaf pages
Next
From: Tom Lane
Date:
Subject: Re: WAL bypass for INSERT, UPDATE and DELETE?