Re: Exporting postgres query to CSV - Mailing list pgsql-general

From Jim C. Nasby
Subject Re: Exporting postgres query to CSV
Date
Msg-id 20060515214140.GR26212@pervasive.com
Whole thread Raw
In response to Re: Exporting postgres query to CSV  (John Purser <jmpurser@gmail.com>)
List pgsql-general
On Tue, May 09, 2006 at 08:57:57AM -0700, John Purser wrote:
> > I am running postgres 7.4.7 on debian sarge.
> First:
> psql -U <PGSQL USER> -o <OUPUT FILE NAME> --pset format=unaligned
> --pset fieldsep=',' -c '<SQL COMMAND HERE>' -d <DATABASE NAME HERE>
>
> I think that will give you the output you were after assuming you're
> scripting psql and that you replace the values in <> with appropriate
> values. The syntax is slightly different from the psql command line.
>
> Second:
> man psql is your friend.

Third:
7.4.7 is ancient and suffers from a number of data loss bugs. If you
need to stick with 7.4 you should at least be running the most current
version.
--
Jim C. Nasby, Sr. Engineering Consultant      jnasby@pervasive.com
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461

pgsql-general by date:

Previous
From: "Jim C. Nasby"
Date:
Subject: Re: Unify distant Postgres databases
Next
From: "Jim C. Nasby"
Date:
Subject: Re: Concatenate WAL contents