Re: generate CSV with Copy+Quotes - Postgres 9.2

Поиск
Список
Период
Сортировка
От Adrian Klaver
Тема Re: generate CSV with Copy+Quotes - Postgres 9.2
Дата
Msg-id ec6a257c-0bfb-d23a-806a-e04dfc36c7ed@aklaver.com
обсуждение исходный текст
Ответ на generate CSV with Copy+Quotes - Postgres 9.2  (Patrick B <patrickbakerbr@gmail.com>)
Ответы Re: generate CSV with Copy+Quotes - Postgres 9.2  (Melvin Davidson <melvin6925@gmail.com>)
Список pgsql-general
On 09/21/2016 02:23 AM, Patrick B wrote:
> 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
>     <mailto:hiddenemail@hotmail.com>,"",John Wayne
>

In your COPY you have fields and in the CSV file you have five.
Are you looking at the correct file?

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

Have no idea what you are trying to say.

hiddenemail@hotmail.com looks like a correct email to me.

Maybe if you show what the data is in the table?

>
> *What I need is:*
>
>     "","","hiddenemail@hotmail.com
>     <mailto: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
>


--
Adrian Klaver
adrian.klaver@aklaver.com


В списке pgsql-general по дате отправления:

Предыдущее
От: ""
Дата:
Сообщение: Re: overwrite column data select - Postgres 9.2
Следующее
От: Melvin Davidson
Дата:
Сообщение: Re: generate CSV with Copy+Quotes - Postgres 9.2