BUG #5032: unexpected syntax error for plpgsql function returns table

Поиск
Список
Период
Сортировка
От Keith Cascio
Тема BUG #5032: unexpected syntax error for plpgsql function returns table
Дата
Msg-id 200909030122.n831MZi9045894@wwwmaster.postgresql.org
обсуждение исходный текст
Ответы Re: BUG #5032: unexpected syntax error for plpgsql function returns table  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-bugs
The following bug has been logged online:

Bug reference:      5032
Logged by:          Keith Cascio
Email address:      keith@cs.ucla.edu
PostgreSQL version: 8.4.0
Operating system:   CentOS 5.3 (Linux)
Description:        unexpected syntax error for plpgsql function returns
table
Details:

Do this:
create function reproduce() returns table(foo integer) language plpgsql as
'begin return query select 1 foo; end;';

Output I got:
ERROR:  syntax error at or near "$1"
LINE 1:  select 1  $1
                   ^
QUERY:   select 1  $1
CONTEXT:  SQL statement in PL/PgSQL function "reproduce" near line 1

Output I expected:
CREATE FUNCTION

The mechanism of this error involves the "foo" return column and the "foo"
alias being identical.  Identifier collision?  If I change one of the "foo"s
to "bar", the definition succeeds.  There are fancier ways to cause similar
unexpected syntax errors, but this is close to a minimal example.

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

Предыдущее
От: "Mark Douglas"
Дата:
Сообщение: BUG #5031: DATE_TRUNC returns the wrong value when specifying MONTH
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: BUG #5032: unexpected syntax error for plpgsql function returns table