Re: Data dumps to files - best methods?

Поиск
Список
Период
Сортировка
От Machiel Richards
Тема Re: Data dumps to files - best methods?
Дата
Msg-id 004a01cb2a5b$e01c4250$a054c6f0$@co.za
обсуждение исходный текст
Ответ на Re: Data dumps to files - best methods?  (Ralf Schuchardt <rasc@gmx.de>)
Список pgsql-general

Thank you very much, I think this will help a lot.

 

Will ask for more details once I receive the full specs,etc...

 

 

 

 

Machiel Richards

MySQL DBA

Email: machielr@rdc.co.za

Tel: 0861 732 732

RDC_Logo

 

From: Ralf Schuchardt [mailto:rasc@gmx.de]
Sent: 23 July 2010 01:37 PM
To: Machiel Richards
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] Data dumps to files - best methods?

 

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 по дате отправления:

Предыдущее
От: Ralf Schuchardt
Дата:
Сообщение: Re: Data dumps to files - best methods?
Следующее
От: arno
Дата:
Сообщение: Re: index scan and functions