Re: BUG #5032: unexpected syntax error for plpgsql function returns table
| От | Pavel Stehule |
|---|---|
| Тема | Re: BUG #5032: unexpected syntax error for plpgsql function returns table |
| Дата | |
| Msg-id | 162867790909022027i79b73b46pc91cd194f183665d@mail.gmail.com обсуждение исходный текст |
| Ответ на | BUG #5032: unexpected syntax error for plpgsql function returns table ("Keith Cascio" <keith@cs.ucla.edu>) |
| Ответы |
Re: BUG #5032: unexpected syntax error for plpgsql function
returns table
Re: BUG #5032: unexpected syntax error for plpgsql function returns table |
| Список | pgsql-bugs |
Hello it's not bug - PostgreSQL doesn't support parameter placeholder on this position. Use dynamic query instead - plpgsql statement EXECUTE. regards Pavel Stehule 2009/9/3 Keith Cascio <keith@cs.ucla.edu>: > > The following bug has been logged online: > > Bug reference: =C2=A0 =C2=A0 =C2=A05032 > Logged by: =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Keith Cascio > Email address: =C2=A0 =C2=A0 =C2=A0keith@cs.ucla.edu > PostgreSQL version: 8.4.0 > Operating system: =C2=A0 CentOS 5.3 (Linux) > Description: =C2=A0 =C2=A0 =C2=A0 =C2=A0unexpected syntax error for plpgs= ql 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: =C2=A0syntax error at or near "$1" > LINE 1: =C2=A0select 1 =C2=A0$1 > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ^ > QUERY: =C2=A0 select 1 =C2=A0$1 > CONTEXT: =C2=A0SQL 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. =C2=A0Identifier collision? =C2=A0If I change one = of the "foo"s > to "bar", the definition succeeds. =C2=A0There are fancier ways to cause = similar > unexpected syntax errors, but this is close to a minimal example. > > -- > Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-bugs >
В списке pgsql-bugs по дате отправления: