This was the default prior to 9.1, but as of 9.1 a backslash in a Postgres string is just a backslash, unless you say SET standard_conforming_strings=off.
Please see my bug report for why this is a problem:
This change should have no effect on users running older versions of Postgres, but will fix the escaping problem for users running 9.1+.
Tell Postgres to accept backslashes in strings.
This was the default prior to 9.1,
but as of 9.1 a backslash in a Postgres string is just a backslash,
unless you say `SET standard_conforming_strings=off`.
FYI: I submitted a slightly different solution to this problem in pull request #250 that tries to deal with quoting the strings, regardless the status of standard_conforming_strings. It also defaults standard_conforming_strings to enabled, like ActiveRecord's default PostgreSQL adapter.
Thanks for the note! I agree it'd be better to follow what the non-JDBC adapter does, to avoid confusion/surprises.
I'm closing this as I've merged the fix in #250.