#30258: Failed to add CheckConstraint on IntegerRangeField
-------------------------------------+-------------------------------------
               Reporter:  Tilman     |          Owner:  nobody
  Koschnick                          |
                   Type:  Bug        |         Status:  new
              Component:  Database   |        Version:  master
  layer (models, ORM)                |
               Severity:  Normal     |       Keywords:
           Triage Stage:             |      Has patch:  1
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 Adding a CheckConstraint like:

 {{{
 constraints = (
 
m.CheckConstraint(check=m.Q(precipitation_probability__contained_by=NumericRange(0,
 101)), name='precipitation_percent_range'),
 )
 }}}

 resulted in the following error (full traceback attached):

 django.db.utils.ProgrammingError: syntax error at or near "object"
 LINE 1: ...obability" <@ <psycopg2._range.NumberRangeAdapter object at ...

 The attached patch fixes the issue for me.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/30258>
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/053.9f2a226040cbd545792fb4207a6bfe82%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to