From: Ziggy Skalski <zskalski@afilias.info>
To: pgsql-admin@postgresql.org
Subject: Re: Extracting data into .csv format
Date: Wed, 17 Feb 2016 12:00:00 -0500
Message-ID: <56C4A710.6050309@afilias.info> (raw)
In-Reply-To: <2BC18916DE4BF141AC1EFC55CE2CAE7D1B8DAE47@NAEANRFKXM01V.nadsusea.nads.navy.mil>
References: <2BC18916DE4BF141AC1EFC55CE2CAE7D1B8DAE47@NAEANRFKXM01V.nadsusea.nads.navy.mil>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: zskalski@afilias.info
Subject: Re: Extracting data into .csv format
In-Reply-To: <56C4A710.6050309@afilias.info>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox