Re: Extracting data into .csv format - Mailing list pgsql-admin

From Ziggy Skalski
Subject Re: Extracting data into .csv format
Date
Msg-id 56C4A710.6050309@afilias.info
Whole thread Raw
In response to Extracting data into .csv format  ("Ferrell, Denise D CTR NSWCDD, H11" <denise.ferrell.ctr@navy.mil>)
List pgsql-admin
On 2016-02-17 11:49 AM, Ferrell, Denise D CTR NSWCDD, H11 wrote:
Using PostgreSQL 9.3 on Linux 

I'm trying to extract data into a comma delimited format and not having much success...seems to act totally different from Oracle.  Does anyone have any suggestions?

Thank you in advance.
Denise
Have you tried something like i.e.:

psql -c "COPY ( QUERY ) TO STDOUT WITH CSV HEADER " > CSV_FILE.csv

Should do the trick (assuming it's basic output you're after).

Regards,

Ziggy

pgsql-admin by date:

Previous
From: Andrea Suisani
Date:
Subject: Re: oracle db reads from postgresql
Next
From: Dave Johansen
Date:
Subject: Re: Setting up streaming replication with new server as master?