Combining \i and \copy in psql

Поиск
Список
Период
Сортировка
От Rhys A.D. Stewart
Тема Combining \i and \copy in psql
Дата
Msg-id CACg0vTk2hJ8NXxVB2e13yMyeSO940d-1K22QV6zXAH5R89fG1Q@mail.gmail.com
обсуждение исходный текст
Ответы Re: Combining \i and \copy in psql  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-general
Greetings,

I have a query in a .sql file and I'd like to use \i to execute it and
\copy to save it to a csv file. Is there any way to combine the two?

Something along the lines of:

\copy \i myquery.sql to 'output.csv'

Rhys
Peace & Love|Live Long & Prosper


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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: Control PhoneNumber Via SQL
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: Combining \i and \copy in psql