Re: BUG #5776: Unable to create view with parameter in PL/pgsql
От | Andrey G. |
---|---|
Тема | Re: BUG #5776: Unable to create view with parameter in PL/pgsql |
Дата | |
Msg-id | AANLkTiksbHxpHTR03UAyB_y0eMFuyXYNwiZfVoFTMRmE@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: BUG #5776: Unable to create view with parameter in PL/pgsql (Robert Haas <robertmhaas@gmail.com>) |
Список | pgsql-bugs |
Robert, Yes, you've read my mind about quote_literal() ;). The bug report is rising exactly the parameter substitution issue. Andrey 2010/12/14 Robert Haas <robertmhaas@gmail.com>: > On Mon, Dec 13, 2010 at 4:28 PM, Andrey G. <andvgal@gmail.com> wrote: >> It seems my original test, which also includes the EXECUTE approach, >> has not come to you in full. EXECUTE statement also fails with >> parameter: The test is attached in file. >> >> psql -q < db/db/pgbug_5776.sql >> ERROR:=C2=A0 there is no parameter $1 >> LINE 1: CREATE VIEW v4 AS SELECT * FROM t1 WHERE some_field =3D $1 >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ^ >> QUERY:=C2=A0 CREATE VIEW v4 AS SELECT * FROM t1 WHERE some_field =3D $1 >> CONTEXT:=C2=A0 PL/pgSQL function "bug_create_tmp_view_exec_test" line 3 = at >> EXECUTE statement > > Yeah, parameter substitution doesn't work in this case. =C2=A0You could > however build up a string with quote_identifier() and then EXECUTE the > resulting string. > > -- > Robert Haas > EnterpriseDB: http://www.enterprisedb.com > The Enterprise PostgreSQL Company >
В списке pgsql-bugs по дате отправления: