Re: Two small questions re/ COPY CSV data into table - Mailing list pgsql-general

From Matthias Apitz
Subject Re: Two small questions re/ COPY CSV data into table
Date
Msg-id 20190604162650.GA15928@sh4-5.1blu.de
Whole thread Raw
In response to Re: Two small questions re/ COPY CSV data into table  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
Responses Re: Two small questions re/ COPY CSV data into table
List pgsql-general
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!



pgsql-general by date:

Previous
From: Laurenz Albe
Date:
Subject: Re: Long running query - connection and keepalives enabled butquery not canceled
Next
From: Frank Alberto Rodriguez
Date:
Subject: Re: One way replication in PostgreSQL