Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hYUhq-0006xV-VE for pgsql-general@arkaria.postgresql.org; Wed, 05 Jun 2019 12:07:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hYUhp-00008b-KQ for pgsql-general@arkaria.postgresql.org; Wed, 05 Jun 2019 12:07:49 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hYUhp-0008Aw-3k for pgsql-general@lists.postgresql.org; Wed, 05 Jun 2019 12:07:49 +0000 Received: from smh-06.1blu.de ([178.254.0.206]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hYUhm-0004ZD-86 for pgsql-general@postgresql.org; Wed, 05 Jun 2019 12:07:47 +0000 Received: from [172.16.29.5] (helo=sh4-5.1blu.de) by smh-06.1blu.de with esmtp (Exim 4.86_2) (envelope-from ) id 1hYUhi-00047A-Nx; Wed, 05 Jun 2019 14:07:43 +0200 Received: from ftp51246-2575596 by sh4-5.1blu.de with local (Exim 4.86_2) (envelope-from ) id 1hYUhi-0003s1-Kw; Wed, 05 Jun 2019 14:07:42 +0200 Date: Wed, 5 Jun 2019 14:07:42 +0200 From: Matthias Apitz To: Andrew Gierth , Postgres general Subject: Re: Two small questions re/ COPY CSV data into table Message-ID: <20190605120742.GA10506@sh4-5.1blu.de> Reply-To: Matthias Apitz References: <20190604100247.GA2800@c720-r342378> <877ea1aby6.fsf@news-spur.riddles.org.uk> <20190604150318.GA13915@sh4-5.1blu.de> <87sgsp8ikd.fsf@news-spur.riddles.org.uk> <20190604162650.GA15928@sh4-5.1blu.de> <87blzd8fdq.fsf@news-spur.riddles.org.uk> <20190604172054.GA4376@sh4-5.1blu.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190604172054.GA4376@sh4-5.1blu.de> X-Operating-System: FreeBSD 12.0-CURRENT r314251 (amd64) X-message-flag: Mails containing HTML will not be read! Please send only plain text. User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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@unixarea.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!