Re: Data dumps to files - best methods?

From: "Machiel Richards" <machielr(at)rdc(dot)co(dot)za>
To: "'Ralf Schuchardt'" <rasc(at)gmx(dot)de>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Data dumps to files - best methods?
Date: 2010-07-26 09:46:19
Message-ID: 002201cb2ca7$920b0f30$b6212d90$@co.za
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi All

Thank you for the responses so far...

I do however have a more specific question regarding this data dump that
I need to create for them.

From what I can see in the specs and current output files, the client
needs the data output in .xml format in order to use this on their side,
still trying to understand why though...

Is there a method of outputting / dumping the data into .xml format
as part of the scripts / crons/ db processes?

Machiel Richards

MySQL DBA

Email: machielr(at)rdc(dot)co(dot)za

Tel: 0861 732 732

RDC_Logo

From: pgsql-general-owner(at)postgresql(dot)org
[mailto:pgsql-general-owner(at)postgresql(dot)org] On Behalf Of Ralf Schuchardt
Sent: 23 July 2010 01:37 PM
To: Machiel Richards
Cc: pgsql-general(at)postgresql(dot)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 <smb://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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Pavel Stehule 2010-07-26 09:47:22 Re: Converting BYTEA from/to BIGINT
Previous Message Vincenzo Romano 2010-07-26 09:32:17 Converting BYTEA from/to BIGINT