Add partial :-variable expansion to psql \copy

Поиск
Список
Период
Сортировка
От Fabien COELHO
Тема Add partial :-variable expansion to psql \copy
Дата
Msg-id PR0P264MB43008330C5069ED01C89DBE7ABAD2@PR0P264MB4300.FRAP264.PROD.OUTLOOK.COM
обсуждение исходный текст
Ответы RE: Add partial :-variable expansion to psql \copy
Re: Add partial :-variable expansion to psql \copy
Список pgsql-hackers
Hello,

I've been biten by psql's \copy lack of variable expansion, in a limited-access docker-inside-VM context where COPY is not a viable option and hardwired names are not desirable. The attached patch allows \copy to use variable's values in place of table and file names:

```psql
\set table 'some table'
\set input 'some file name.csv'
\copy :"table" from :'input' with (format csv)
```

--
Fabien.

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