Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxx, http://www.unixarea.de/ +49-176-38902045
Public GnuPG key: http://www.unixarea.de/key.pub
May, 9: Спаси́бо освободители! Thank you very much, Russian liberators!





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux