#29171: PostgreSQL specific model fields - ArrayField: Type Mismatch
-------------------------------------+-------------------------------------
     Reporter:  Pal                  |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  2.0
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:  Postgres Array       |             Triage Stage:
  Query                              |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Pal):

 Replying to [comment:2 Simon Charette]:
 > Could you provide a traceback and more details about how ''it fails''?
 >
 > Does it happen when you define a model using `ArrayField(CharField())`,
 when performing a query annotation?

 Yes. When I defined the model as shown in the documentation at
 https://docs.djangoproject.com/en/2.0/ref/contrib/postgres/fields
 /#querying-arrayfield , the query fails. But if I change models.CharField
 to models.TextField, the query succeeds.

 Here are the error statements from apache2 error log:
 psycopg2.ProgrammingError: operator does not exist: text[] @> character
 varying[]
 django.db.utils.ProgrammingError: operator does not exist: text[] @>
 character varying[]

 May be we need to change the documentation to reflect the change above.
 Thanks.

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

Reply via email to