Re: Export SELECT statement as SQL queries in file

Поиск
Список
Период
Сортировка
От Sean Davis
Тема Re: Export SELECT statement as SQL queries in file
Дата
Msg-id 200705040956.03630.sdavis2@mail.nih.gov
обсуждение исходный текст
Ответ на Export SELECT statement as SQL queries in file  ("Mario Peshev" <nofearinc@gmail.com>)
Список pgsql-novice
On Friday 04 May 2007 09:45, Mario Peshev wrote:
> Hey there,
>
> I'm interested in getting the content of a SQL query into a file (possibly
> as an INSERT clause). Is it possible to be done with an SQL statement? Now
> I think it could be realised as [\copy (statement) to 'file'] construction,
> but it's psql command. Is there another way?

There is also a server-side copy:

http://www.postgresql.org/docs/current/static/sql-copy.html

Otherwise, you will need to use a client (of which there are many).  Also, at
least perl, python, and java all have readily accessible client modules, so
you can write short scripts to do what you want.

Sean

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

Предыдущее
От: "Mario Peshev"
Дата:
Сообщение: Export SELECT statement as SQL queries in file
Следующее
От: "Christian Leclerc"
Дата:
Сообщение: Trigger and Notify