Re: Dump and Query

Поиск
Список
Период
Сортировка
От Bricklen Anderson
Тема Re: Dump and Query
Дата
Msg-id 45929C88.6000808@presinet.com
обсуждение исходный текст
Ответ на Re: Dump and Query  ("Andy Shellam (Mailing Lists)" <andy.shellam-lists@mailnetwork.co.uk>)
Список pgsql-admin
Andy Shellam (Mailing Lists) wrote:
> Hi Enrico,
>
> The following command will get you a text file of your result-set:
>
> # echo "SELECT customer_id, first_name, sur_name FROM
> users;"|/usr/local/pgsql/bin/psql -U [username] -d [database] > myfile.txt
> # cat myfile.txt

Alternative version:

psql -d <your dbname> -c "SELECT customer_id, first_name, sur_name FROM
users" -o myfile.txt

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

Предыдущее
От: "Shoaib Mir"
Дата:
Сообщение: Re: Dump and Query
Следующее
От: Tom Lane
Дата:
Сообщение: Re: psql does not save contents into file at end of command.