From 779cd28acb1f7eb06f629c0ea4ded99b5ebb670a Mon Sep 17 00:00:00 2001 From: Mariusz Felisiak Date: Fri, 22 Sep 2023 06:01:11 +0200 Subject: Fixed #34840 -- Avoided casting string base fields on PostgreSQL. Thanks Alex Vandiver for the report. Regression in 09ffc5c1212d4ced58b708cbbf3dfbfb77b782ca. --- django/db/backends/postgresql/operations.py | 8 -------- 1 file changed, 8 deletions(-) (limited to 'django/db/backends/postgresql') diff --git a/django/db/backends/postgresql/operations.py b/django/db/backends/postgresql/operations.py index 93eb982f4b..4a42126e81 100644 --- a/django/db/backends/postgresql/operations.py +++ b/django/db/backends/postgresql/operations.py @@ -154,14 +154,6 @@ class DatabaseOperations(BaseDatabaseOperations): def lookup_cast(self, lookup_type, internal_type=None): lookup = "%s" - - if lookup_type == "isnull" and internal_type in ( - "CharField", - "EmailField", - "TextField", - ): - return "%s::text" - # Cast text lookups to text to allow things like filter(x__contains=4) if lookup_type in ( "iexact", -- cgit v1.3