generate CSV with Copy+Quotes - Postgres 9.2

Поиск
Список
Период
Сортировка
От Patrick B
Тема generate CSV with Copy+Quotes - Postgres 9.2
Дата
Msg-id CAJNY3itoGeMk_t-Wj7orG1VLm3SunMCHvg3AkvCBGpwJr5ckXQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: generate CSV with Copy+Quotes - Postgres 9.2  (Adrian Klaver <adrian.klaver@aklaver.com>)
Список 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 по дате отправления:

Предыдущее
От: Patrick B
Дата:
Сообщение: Re: overwrite column data select - Postgres 9.2
Следующее
От: ""
Дата:
Сообщение: Re: overwrite column data select - Postgres 9.2