Search Postgresql Archives

Re: plpgsql syntax error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On 10 October 2011 21:35, József Kurucz <jozsef.kurucz@xxxxxxxxxx> 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@xxxxxxxxx)

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



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux