I have been having a problem where we're using Sequel to migrate from a mysql database (utf8) to postgresql (utf8) and line breaks (\r\n) on the mysql side were appearing as \015\012 in the postgres side. I thought it was a character encoding issue, but eventually tracked it down to the fact that Sequel thinks a mysql text column is a blob. When it is inserted into postgres, literal_blob is called on the column, which converts \r\n into \015\012.
I'm guessing this is not the intended behavior, but before I tried to dig around in the code (which I am completely new to), I wanted to make sure there wasn't some deeper reason that MySQL text columns are being treated as blobs. It's quite possible I'm doing something wrong... Any ideas? To reproduce the situation: in mysql: create table mytest1 (comments text); in postgres: create table mytest1 (comments text); in ruby (assuming you have mysql_db and pg_db Sequel connections to each db): mysql_db[:mytest1].insert "1\r\n2\r\n3\r\n" # correctly inserted in mysql db pg_db[:mytest1].insert mysql_db[:mytest1].first[:comments] # incorrectly inserted in pg db It works correctly if instead you do: pg_db[:mytest1].insert mysql_db[:mytest1].first[:comments].to_s --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sequel-talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/sequel-talk?hl=en -~----------~----~----~----~------~----~------~--~---
