Re: BUG #7943: plpgsql parsing bug

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #7943: plpgsql parsing bug
Дата
Msg-id 20846.1363319341@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #7943: plpgsql parsing bug  (rikard@ngs.hr)
Ответы Re: BUG #7943: plpgsql parsing bug  (Rikard Pavelic <rikard@ngs.hr>)
Список pgsql-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

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #7942: Timestamp "19991231 240000" should not be out of range
Следующее
От: Tom Lane
Дата:
Сообщение: Re: ERROR: syntax error in tsquery - for high-unicode whitespace