psql variable quoting

Поиск
Список
Период
Сортировка
От Artacus
Тема psql variable quoting
Дата
Msg-id 48EDB56F.7070605@comcast.net
обсуждение исходный текст
Список pgsql-general
I'm having quoting issues... or concatenation or just issues when trying
to use psql variables.

TRUNCATE TABLE :tbl;
COPY :tbl FROM xxxxx WITH CSV HEADER;

For xxxxx I want to do a concatenation of :import_path :tbl '.csv'
Obviously I can't have the spaces in it. If I remove the spaces, it
doesn't expand the variables.

I can set a import_file variable like so:
\set import_file '/tmp/:tbl.csv'
That expands properly but isn't quoted when used in the COPY command.

How do I do this?

Artacus

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

Предыдущее
От: hubert depesz lubaczewski
Дата:
Сообщение: Re: review db dump script and difference between pg_dump & pg_dumpall
Следующее
От: Julius Tuskenis
Дата:
Сообщение: Re: [pgadmin-support] problem with check constraints