Tell Postgres to accept backslashes in strings. #248

Closed
wants to merge 1 commit into
from

Projects

None yet

3 participants

@pjungwir

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:

#247

This change should have no effect on users running older versions of Postgres, but will fix the escaping problem for users running 9.1+.

@pjungwir pjungwir 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`.
1854e8e
@GUI
Contributor
GUI commented Oct 23, 2012

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.

@pjungwir

Thanks for the note! I agree it'd be better to follow what the non-JDBC adapter does, to avoid confusion/surprises.

@ajuckel
Contributor
ajuckel commented Oct 23, 2012

I'm closing this as I've merged the fix in #250.

@ajuckel ajuckel closed this Oct 23, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment