summaryrefslogtreecommitdiff
path: root/django/db/backends/postgresql/base.py
diff options
context:
space:
mode:
authorJayantha Gumballi <jayantha.gumballi@gmail.com>2018-11-01 20:44:34 +0530
committerTim Graham <timograham@gmail.com>2018-11-01 11:14:34 -0400
commitdfcdc8992f8bbbf072cefa4d325fe5cac5316f3d (patch)
treede4a3cae1fafed36bdbfc7040d9349e0dd39dc16 /django/db/backends/postgresql/base.py
parent74ddd0e83b039268e2988b777753cf01e417ccc1 (diff)
downloaddjango-dfcdc8992f8bbbf072cefa4d325fe5cac5316f3d.tar.gz
Fixed #29886 -- Fixed unaccent lookup when PostgreSQL's standard_conforming_strings option is off.
Thanks Tom McClure for the patch.
Diffstat (limited to 'django/db/backends/postgresql/base.py')
-rw-r--r--django/db/backends/postgresql/base.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/django/db/backends/postgresql/base.py b/django/db/backends/postgresql/base.py
index ad6c504261..9de9b44735 100644
--- a/django/db/backends/postgresql/base.py
+++ b/django/db/backends/postgresql/base.py
@@ -121,7 +121,7 @@ class DatabaseWrapper(BaseDatabaseWrapper):
#
# Note: we use str.format() here for readability as '%' is used as a wildcard for
# the LIKE operator.
- pattern_esc = r"REPLACE(REPLACE(REPLACE({}, '\', '\\'), '%%', '\%%'), '_', '\_')"
+ pattern_esc = r"REPLACE(REPLACE(REPLACE({}, E'\\', E'\\\\'), E'%%', E'\\%%'), E'_', E'\\_')"
pattern_ops = {
'contains': "LIKE '%%' || {} || '%%'",
'icontains': "LIKE '%%' || UPPER({}) || '%%'",