summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorTilman Koschnick <til@subnetz.org>2021-01-28 17:50:54 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2021-01-29 11:05:00 +0100
commitfdfbc66331292def201c9344e3cd29fbcbcd076a (patch)
tree42e10a5a20c101ed7cb5eeb172090147356dfb2a /django
parent135c800fe6138d7818501a384c0ebbdc5442762c (diff)
Fixed #32392 -- Fixed ExclusionConstraint crash with Cast() in expressions.
Diffstat (limited to 'django')
-rw-r--r--django/db/models/functions/comparison.py6
1 files changed, 0 insertions, 6 deletions
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.