ActiveRecord is calling into the PGconn instance for the method escape() to escape strings. This method does not appear to be escaping backslashes at all, which causes syntax errors in the SQL, if the backslash occurs at the end of a string:
conn = ActiveRecord::Base.connection.instance_variable_get("@Luis Santana")
=> "Foo \"
I noticed this in 0.8.0, and just upgraded to 0.9.0 and found the same problem.