Re: Two small questions re/ COPY CSV data into table
| От | Matthias Apitz |
|---|---|
| Тема | Re: Two small questions re/ COPY CSV data into table |
| Дата | |
| Msg-id | 20190604162650.GA15928@sh4-5.1blu.de обсуждение |
| Ответ на | Re: Two small questions re/ COPY CSV data into table (Andrew Gierth <andrew@tao11.riddles.org.uk>) |
| Ответы |
Re: Two small questions re/ COPY CSV data into table
|
| Список | 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 по дате отправления: