On Mon, Dec 13, 2010 at 4:28 PM, Andrey G. <andv...@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:  there is no parameter $1
> LINE 1: CREATE VIEW v4 AS SELECT * FROM t1 WHERE some_field = $1
>                                                               ^
> QUERY:  CREATE VIEW v4 AS SELECT * FROM t1 WHERE some_field = $1
> CONTEXT:  PL/pgSQL function "bug_create_tmp_view_exec_test" line 3 at
> EXECUTE statement

Yeah, parameter substitution doesn't work in this case.  You 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

-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

Reply via email to