generate CSV with Copy+Quotes - Postgres 9.2 - Mailing list pgsql-general

From Patrick B
Subject generate CSV with Copy+Quotes - Postgres 9.2
Date
Msg-id CAJNY3itoGeMk_t-Wj7orG1VLm3SunMCHvg3AkvCBGpwJr5ckXQ@mail.gmail.com
Whole thread Raw
Responses Re: generate CSV with Copy+Quotes - Postgres 9.2  (Adrian Klaver <adrian.klaver@aklaver.com>)
List pgsql-general
Hi guys,

I'm exporting some data for testing purpose.

COPY (SELECT
        name_first
        name_last,
        email,
        company
FROM
        clients
)
TO '/var/lib/pgsql/test1.csv' DELIMITER ',' csv HEADER QUOTE '"';


 cat /var/lib/pgsql/test1.csv

"","",hiddenemail@hotmail.com,"",John Wayne


See how the email and the company aren't into two "?

What I need is:

"","","hiddenemail@hotmail.com","","John Wayne"


I thought that by putting QUOTE the COPY would do that?

Is there any way I can put the " into those fields?

Cheers

Patrick

pgsql-general by date:

Previous
From: Patrick B
Date:
Subject: Re: overwrite column data select - Postgres 9.2
Next
From: ""
Date:
Subject: Re: overwrite column data select - Postgres 9.2