#32858: Syntax error when using an index transform on an ArrayField in an
ExclusionConstraint
-------------------------------------+-------------------------------------
     Reporter:  Lucidiot             |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  3.2
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Simon Charette):

 * stage:  Unreviewed => Accepted


Comment:

 The proposed solution makes sense to me, looks like #32392 was just a
 workaround in the end.

 It should be easy enough to add the conditional `f'({sql})'` wrapping if
 `isinstance(expression, Col)` as you've mentioned (`Col` is
 `django.db.models.expressions.Col`).

 
https://github.com/django/django/blob/225d96533a8e05debd402a2bfe566487cc27d95f/django/contrib/postgres/constraints.py#L72-L83

 Would you be able to provide a patch/PR?

 I also wonder if we should just revert the non-test bits of
 fdfbc66331292def201c9344e3cd29fbcbcd076a since it might just be hiding
 other instances of this problem.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/32858#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.570b6b6ce7eb54379de1f2e76e0172eb%40djangoproject.com.

Reply via email to