Re: plpgsql syntax error

From: József Kurucz <jozsef(dot)kurucz(at)invitel(dot)hu>
To: Ondrej Ivanič <ondrej(dot)ivanic(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: plpgsql syntax error
Date: 2011-10-13 17:15:26
Message-ID: CAGJF9eGZnbg4bkgzzutsC0XeLLDZ71M=iG=jxHTKQRvX5qRBvQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Many Thanks!!! It works!

Regards,

Josef

2011/10/10 Ondrej Ivanič <ondrej(dot)ivanic(at)gmail(dot)com>:
> Hi,
>
> On 10 October 2011 21:35, József Kurucz <jozsef(dot)kurucz(at)invitel(dot)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(dot)ivanic(at)gmail(dot)com)
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2011-10-13 17:16:29 Re: Tablespace files deleted during continuous run
Previous Message Merlin Moncure 2011-10-13 16:59:01 Re: could not reattach to shared memory