From 4d3b8e199ec00a0aba111637a25f5abcaf3d6dfc Mon Sep 17 00:00:00 2001 From: Mads Jensen Date: Tue, 14 Nov 2017 22:51:51 +0100 Subject: [2.0.x] Fixed #28702 -- Made query lookups for CIText fields use citext. Backport of f0a68c25118786d47041d0a435b2afa953be3c86 from master --- django/db/backends/postgresql/operations.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'django/db/backends/postgresql/operations.py') diff --git a/django/db/backends/postgresql/operations.py b/django/db/backends/postgresql/operations.py index 268fa99b51..c4a61f7070 100644 --- a/django/db/backends/postgresql/operations.py +++ b/django/db/backends/postgresql/operations.py @@ -77,6 +77,8 @@ class DatabaseOperations(BaseDatabaseOperations): 'istartswith', 'endswith', 'iendswith', 'regex', 'iregex'): if internal_type in ('IPAddressField', 'GenericIPAddressField'): lookup = "HOST(%s)" + elif internal_type in ('CICharField', 'CIEmailField', 'CITextField'): + lookup = '%s::citext' else: lookup = "%s::text" -- cgit v1.3