#24726: ArrayField with IntegerRangeField as base field generates invalid SQL on
Insert operations
----------------------------------+------------------------------------
     Reporter:  edrmp             |                    Owner:
         Type:  Bug               |                   Status:  new
    Component:  contrib.postgres  |                  Version:  master
     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
----------------------------------+------------------------------------

Comment (by dvarrazzo):

 Hello,

 I think your best shot is to use a `NumericRange` subtype with an adapter
 adding `::int4range`. Adding `::int4range[]` after the array is
 impractical as you should know subclass the list instead.

 An example implementation is in
 [https://github.com/psycopg/psycopg2/issues/313#issuecomment-108295518
 this comment].

 I'll think whether we should introduce these objects in the library, I'm
 not so sure, because usually end users are able to specify a placeholder
 like `%s::int4range[]` and work around the problem without introducing too
 many details of the Postgres data system into the Python objects.

--
Ticket URL: <https://code.djangoproject.com/ticket/24726#comment:5>
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/063.e11e1db29d7365193dd619d818b2b896%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to