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]

 



>>>>> "Matthias" == Matthias Apitz <guru@xxxxxxxxxxx> 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)





[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