diff options
| author | Jacob Kaplan-Moss <jacob@jacobian.org> | 2008-08-25 12:56:06 +0000 |
|---|---|---|
| committer | Jacob Kaplan-Moss <jacob@jacobian.org> | 2008-08-25 12:56:06 +0000 |
| commit | 3df72660560730393fc958700d2a3ab975c4b361 (patch) | |
| tree | 9da68ca3094b0d24abe06e1438cb1f18e8c43ada /django/db/backends/postgresql/base.py | |
| parent | 06d49768bd6974a455e6dd46e9526a093721897e (diff) | |
Fixed #3575: use UPPER() instead ILIKE for postgres case-insensitive comparisons.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8536 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/db/backends/postgresql/base.py')
| -rw-r--r-- | django/db/backends/postgresql/base.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/django/db/backends/postgresql/base.py b/django/db/backends/postgresql/base.py index 7bcda5b6f6..376d7ba2c8 100644 --- a/django/db/backends/postgresql/base.py +++ b/django/db/backends/postgresql/base.py @@ -70,9 +70,9 @@ class DatabaseFeatures(BaseDatabaseFeatures): class DatabaseWrapper(BaseDatabaseWrapper): operators = { 'exact': '= %s', - 'iexact': 'ILIKE %s', + 'iexact': '= UPPER(%s)', 'contains': 'LIKE %s', - 'icontains': 'ILIKE %s', + 'icontains': 'LIKE UPPER(%s)', 'regex': '~ %s', 'iregex': '~* %s', 'gt': '> %s', @@ -81,8 +81,8 @@ class DatabaseWrapper(BaseDatabaseWrapper): 'lte': '<= %s', 'startswith': 'LIKE %s', 'endswith': 'LIKE %s', - 'istartswith': 'ILIKE %s', - 'iendswith': 'ILIKE %s', + 'istartswith': 'LIKE UPPER(%s)', + 'iendswith': 'LIKE UPPER(%s)', } def __init__(self, *args, **kwargs): |
