Hi,
On 10 October 2011 21:35, József Kurucz <jozsef.kurucz@invitel.hu> wrote:
> ERROR: syntax error at or near "$1"
> LINE 1: create table $1 ( )
> ^
> QUERY: create table $1 ( )
> CONTEXT: SQL statement in PL/PgSQL function "check_table" near line 22
I think you have to use "execute":
execute 'create table ' || tblname || ' ()';
http://www.postgresql.org/docs/current/static/plpgsql-statements.html#PLPGSQL-STATEMENTS-EXECUTING-DYN
--
Ondrej Ivanic
(ondrej.ivanic@gmail.com)