Hi,

On 10 October 2011 21:35, József Kurucz <[email protected]> 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
([email protected])

-- 
Sent via pgsql-general mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to