Re: Two small questions re/ COPY CSV data into table

From: Matthias Apitz <guru(at)unixarea(dot)de>
To: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>, Postgres general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Two small questions re/ COPY CSV data into table
Date: 2019-06-05 12:07:42
Message-ID: 20190605120742.GA10506@sh4-5.1blu.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

El día Tuesday, June 04, 2019 a las 07:20:54PM +0200, Matthias Apitz escribió:

> El día Tuesday, June 04, 2019 a las 05:56:49PM +0100, Andrew Gierth escribió:
>
> > If you use COPY ... WITH DELIMITER '|' (i.e. text mode, not CSV mode)
> > then the \| is accepted as being a literal | and the unescaped | is
> > treated as a delimiter. What is the point of the substitutions?
>
> ...

> I will provide tomorrow the exact input line, the exact COPY command and
> the error.

It works exactly as Andrew states. My error was not caused by treating
the '|' of '\|' as DELIMITER, but by not having WITH (NULL '' ...) in the COPY cmd.
I misinterpreted the error message as not matching number of columns.
Sorry for the noise.

Thanks

matthias
--
Matthias Apitz, ✉ guru(at)unixarea(dot)de, http://www.unixarea.de/ +49-176-38902045
Public GnuPG key: http://www.unixarea.de/key.pub
May, 9: Спаси́бо освободители! Thank you very much, Russian liberators!

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Sathish Kumar 2019-06-05 12:46:16 Re: pg_repack issue
Previous Message Prakash Ramakrishnan 2019-06-05 11:55:20 Re: pg_repack issue