Search Postgresql Archives

generate CSV with Copy+Quotes - Postgres 9.2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxx,"",John Wayne


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

What I need is:

"","","hiddenemail@xxxxxxxxxxx","","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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux