From: Tom Lane <tgl@sss.pgh.pa.us>
To: rikard@ngs.hr
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #7943: plpgsql parsing bug
Date: Thu, 14 Mar 2013 23:49:01 -0400
Message-ID: <20846.1363319341@sss.pgh.pa.us> (raw)
In-Reply-To: <E1UGDwW-0003XF-2l@wrigleys.postgresql.org>
References: <E1UGDwW-0003XF-2l@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
rikard@ngs.hr writes:
> The following bug has been logged on the website:
> Bug reference: 7943
> Logged by: Rikard Pavelic
> Email address: rikard@ngs.hr
> PostgreSQL version: 9.2.1
> Operating system: Windows 7
> Description:
> ERROR: "_t1" is not a scalar variable
> LINE 12: for _i1, _i2, _t1, _t2, _t3, _b in select * from (
> ^
[ shrug ... ] It's right: _t1 is not a scalar variable. (It has
the composite type s.)
The reason this is problematic is that writing a composite variable as
the target of a FOR IN SELECT loop is defined as assigning all the
columns from the SELECT into fields of the composite variable. Which
is not what you wanted to have happen there, even if we were to extend
the definition to allow a mixture of scalar and composite variables in
the target list.
I'd suggest declaring a record variable and using that as the target.
regards, tom lane
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, rikard@ngs.hr
Subject: Re: BUG #7943: plpgsql parsing bug
In-Reply-To: <20846.1363319341@sss.pgh.pa.us>
References: <E1UGDwW-0003XF-2l@wrigleys.postgresql.org> <20846.1363319341@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox