>>>>> "Matthias" == Matthias Apitz <guru@unixarea.de> writes:
Matthias> sed 's/|/\v/g' < table-from-Sybase | sed 's/\\\v/|/g' > table-for-copy
>> What on earth is this supposed to achieve?
Matthias> It first translates any char '|' to vtab and then any '\vtab'
Matthias> (i.e. a backslash followed by a vtab) back to the char |
Matthias> The new DELIMITER for PG is then vtab and the | is just a char in the
Matthias> data (in the example above a pipe of two UNIX cmd).
Yes, but why?
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?
--
Andrew (irc:RhodiumToad)