Re: Data dumps to files - best methods?

Поиск
Список
Период
Сортировка
От Ralf Schuchardt
Тема Re: Data dumps to files - best methods?
Дата
Msg-id 30C7A51C-21E8-4583-AED1-8400019B584D@gmx.de
обсуждение исходный текст
Ответ на Data dumps to files - best methods?  ("Machiel Richards" <machielr@rdc.co.za>)
Ответы Re: Data dumps to files - best methods?  ("Machiel Richards" <machielr@rdc.co.za>)
Re: Data dumps to files - best methods?  ("Machiel Richards" <machielr@rdc.co.za>)
Список pgsql-general
Hi,

Am 23.07.2010 um 10:32 schrieb Machiel Richards:

       As I am fairly new to postgresql I am trying to find some more info regarding options to dump specific data to files. 

     However, even though I can get the sql query,etc... how will I use this to dump the data into the relevant files?

You can use the "\copy" command in psql to export the result of query into a file. For example:

> psql -c "\\copy (select * from atable) to 'myfile.csv' with delimiter as ',' csv header" adb

will copy all rows from "atable" in "adb" to "myfile.csv" in csv format.


Ralf

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

Предыдущее
От: Tom Robst
Дата:
Сообщение: Re: Centos 5.5 and Postgres 9.0.beta3 install errors
Следующее
От: "Machiel Richards"
Дата:
Сообщение: Re: Data dumps to files - best methods?