Expanding psql variables

Поиск
Список
Период
Сортировка
От mephysto
Тема Expanding psql variables
Дата
Msg-id 1328109870909-5447801.post@n5.nabble.com
обсуждение исходный текст
Список pgsql-general
Hello to everyone,
I'm trying to use variables in psql script to create some stored funtions.
The problem is that psql variables are not expanded if it is into a dollar
quoted string. This is my example:

\set my_schema foo

CREATE OR REPLACE FUNCTION foo() RETURNS VOID AS
$BODY$
        SELECT * FROM :my_schema.my_table;
$BODY$
LANGUAGE sql;


In this manner I receive a syntax error near:


The question is: is there a manner to expand psql script variables inside
dollar quoted string?

Thanks in advance.

Mephysto

--
View this message in context: http://postgresql.1045698.n5.nabble.com/Expanding-psql-variables-tp5447801p5447801.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

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

Предыдущее
От: Merlin Moncure
Дата:
Сообщение: Re: Issue with CREATE EXTENSION tablefuncKreiter
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Issue with CREATE EXTENSION tablefuncKreiter