No quotes in output of "psql \copy CSV"

From: Arnaud Lesauvage <arnaud(dot)listes(at)codata(dot)eu>
To: pgsql-general(at)postgresql(dot)org
Subject: No quotes in output of "psql \copy CSV"
Date: 2010-06-29 12:24:00
Message-ID: 4C29E5E0.9040508@codata.eu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi all,

I'd like to generate CSV files from the output of a query.
The files must be generated on the client, so I was planning on using
psql \copy command.
I can't get the srings in the output to be quoted though. I thought that
this was the default for CSV, and even adding the "QUOTE" parameter does
not help :

postgres=# \copy (SELECT 1, 'test', 'foo', 'bar', TRUE, FALSE) TO stdout
CSV QUOTE '"' DELIMITER ','
1,test,foo,bar,t,f

postgres=# \copy (SELECT 1, 'test', 'foo', 'bar', TRUE, FALSE) TO stdout CSV
1,test,foo,bar,t,f

What am I missing here ?

Thanks for your help !
Regards
--
Arnaud Lesauvage

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Sam Mason 2010-06-29 12:40:39 Re: No quotes in output of "psql \copy CSV"
Previous Message A. Kretschmer 2010-06-29 12:20:51 Re: alter table schema, default sequences stay the same