From fdfbc66331292def201c9344e3cd29fbcbcd076a Mon Sep 17 00:00:00 2001 From: Tilman Koschnick Date: Thu, 28 Jan 2021 17:50:54 +0100 Subject: Fixed #32392 -- Fixed ExclusionConstraint crash with Cast() in expressions. --- django/db/models/functions/comparison.py | 6 ------ 1 file changed, 6 deletions(-) (limited to 'django') diff --git a/django/db/models/functions/comparison.py b/django/db/models/functions/comparison.py index 8a1c34430b..2976985db8 100644 --- a/django/db/models/functions/comparison.py +++ b/django/db/models/functions/comparison.py @@ -42,12 +42,6 @@ class Cast(Func): template = "JSON_EXTRACT(%(expressions)s, '$')" return self.as_sql(compiler, connection, template=template, **extra_context) - def as_postgresql(self, compiler, connection, **extra_context): - # CAST would be valid too, but the :: shortcut syntax is more readable. - # 'expressions' is wrapped in parentheses in case it's a complex - # expression. - return self.as_sql(compiler, connection, template='(%(expressions)s)::%(db_type)s', **extra_context) - def as_oracle(self, compiler, connection, **extra_context): if self.output_field.get_internal_type() == 'JSONField': # Oracle doesn't support explicit cast to JSON. -- cgit v1.3