2018-06-25 16:25 GMT+02:00 Anto Aravinth <anto.aravinth.cse@xxxxxxxxx>:Thanks a lot. But I do got lot of challenges! Looks like SO data contains lot of tabs within itself.. So tabs delimiter didn't work for me. I thought I can give a special demiliter but looks like Postrgesql copy allow only one character as delimiter :(Sad, I guess only way is to insert or do a through serialization of my data into something that COPY can understand.easiest way would be:xml -> csv -> \copyby csv, I mean regular quoted csv (Simply wrap csv field with double quote, and escapeenventually contained quotes with an other double quote.).
1 "Are questions about animations or comics inspired by Japanese culture or styles considered on-topic?" "pExamples include a href="" href="http://www.imdb.com/title/tt0417299/">http://www.imdb.com/title/tt0417299/"" rel=""nofollow""Avatar/a, a href="" href="http://www.imdb.com/title/tt1695360/">http://www.imdb.com/title/tt1695360/"" rel=""nofollow""Korra/a and, to some extent, a href="" href="http://www.imdb.com/title/tt0278238/">http://www.imdb.com/title/tt0278238/"" rel=""nofollow""Samurai Jack/a. They're all widely popular American cartoons, sometimes even referred to as ema href="" href="https://en.wikipedia.org/wiki/Anime-influenced_animation">https://en.wikipedia.org/wiki/Anime-influenced_animation"" rel=""nofollow""Amerime/a/em./p
pAre questions about these series on-topic?/p
" "pExamples include a href="" href="http://www.imdb.com/title/tt0417299/">http://www.imdb.com/title/tt0417299/"" rel=""nofollow""Avatar/a, a href="" href="http://www.imdb.com/title/tt1695360/">http://www.imdb.com/title/tt1695360/"" rel=""nofollow""Korra/a and, to some extent, a href="" href="http://www.imdb.com/title/tt0278238/">http://www.imdb.com/title/tt0278238/"" rel=""nofollow""Samurai Jack/a. They're all widely popular American cartoons, sometimes even referred to as ema href="" href="https://en.wikipedia.org/wiki/Anime-influenced_animation">https://en.wikipedia.org/wiki/Anime-influenced_animation"" rel=""nofollow""Amerime/a/em./p
pAre questions about these series on-topic?/p
" "null"
COPY so2 from '/Users/user/programs/js/node-mbox/file.csv';
I get:
CONTEXT: COPY so2, line 1: "1 "Are questions about animations or comics inspired by Japanese culture or styles considered on-top..."
Not sure what I'm missing. Not sure the above csv is breaking because I have newlines within my content. But the error message is very hard to debug.
Postgresql copy csv parser is one of the most robust I ever testedbefore.