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 1hYCH2-0001dP-ME for pgsql-general@arkaria.postgresql.org; Tue, 04 Jun 2019 16:26:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hYCH1-00021P-Fb for pgsql-general@arkaria.postgresql.org; Tue, 04 Jun 2019 16:26:55 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hYCH1-00021I-6C for pgsql-general@lists.postgresql.org; Tue, 04 Jun 2019 16:26:55 +0000 Received: from smh-06.1blu.de ([178.254.0.206]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hYCGy-0005ul-Lp for pgsql-general@postgresql.org; Tue, 04 Jun 2019 16:26:54 +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 1hYCGw-0003gF-9n; Tue, 04 Jun 2019 18:26:50 +0200 Received: from ftp51246-2575596 by sh4-5.1blu.de with local (Exim 4.86_2) (envelope-from ) id 1hYCGw-0004fe-7E; Tue, 04 Jun 2019 18:26:50 +0200 Date: Tue, 4 Jun 2019 18:26:50 +0200 From: Matthias Apitz To: Andrew Gierth Cc: Matthias Apitz , Postgres general Subject: Re: Two small questions re/ COPY CSV data into table Message-ID: <20190604162650.GA15928@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> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87sgsp8ikd.fsf@news-spur.riddles.org.uk> 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 04:41:47PM +0100, Andrew Gierth escribió: > Matthias> I do load this now with COPY in mode TEXT and modify the data > Matthias> before with: > > Matthias> sed 's/|/\v/g' < table-from-Sybase | sed 's/\\\v/|/g' > table-for-copy > > What on earth is this supposed to achieve? It first translates any char '|' to vtab and then any '\vtab' (i.e. a backslash followed by a vtab) back to the char | The new DELIMITER for PG is then vtab and the | is just a char in the data (in the example above a pipe of two UNIX cmd). Do you do UNIX? 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!