Re: problem with variable

Поиск
Список
Период
Сортировка
От Tim Landscheidt
Тема Re: problem with variable
Дата
Msg-id m3zkz4xvlh.fsf@passepartout.tim-landscheidt.de
обсуждение исходный текст
Ответ на problem with variable  ("coviolo@libero.it" <coviolo@libero.it>)
Список pgsql-novice
"coviolo@libero.it" <coviolo@libero.it> wrote:

> When the trigger executes the function which I copy below:

> IF (TG_OP = 'UPDATE') THEN
> EXECUTE 'CREATE TABLE '||NEW.nome_tabella||' (ordinativo serial PRIMARY KEY
> CHECK (nome_tabella = '||NEW.nome_tabella||'::text))
                        ^                    ^
> INHERITS (database_t);

> first use of the variable '||NEW.nome_tabella||' is correct and the table is
> created with the name, for example "azienda_vallone", but I do not know why,
> the second use of the variable is incorrect because the CHECK insert on table
> is nome_tabella = azienda_vallone.*.
> I can not understand why postgresql insert point and asterisk at the end of
> the variable.
> if anyone can give me some suggestions on how to resolve...

You probably need to replace the last two quotes with "'''".

Tim

В списке pgsql-novice по дате отправления:

Предыдущее
От: "Machiel Richards"
Дата:
Сообщение: Additional info on request: Variables in SQL scripts
Следующее
От: "coviolo@libero.it"
Дата:
Сообщение: Re: problem with variable