[Django] #22907: ArrayField querying doesn't work with CharField

16 views
Skip to first unread message

Django

unread,
Jun 26, 2014, 1:23:14 AM6/26/14
to django-...@googlegroups.com
#22907: ArrayField querying doesn't work with CharField
----------------------------------+--------------------
Reporter: Suor | Owner:
Type: Bug | Status: new
Component: contrib.postgres | Version: master
Severity: Release blocker | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
----------------------------------+--------------------
When trying to make query with
`CharArrayModel.objects.filter(field__contains=['text'])` I get:

{{{
ProgrammingError: operator does not exist: character varying[] @> text[]
LINE 1: ...el" WHERE "postgres_tests_chararraymodel"."field" @> ARRAY['...
^
HINT: No operator matches the given name and argument type(s). You might
need to add explicit type casts.
}}}

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

Django

unread,
Jun 26, 2014, 1:26:10 AM6/26/14
to django-...@googlegroups.com
#22907: ArrayField querying doesn't work with CharField
----------------------------------+--------------------------------------

Reporter: Suor | Owner:
Type: Bug | Status: new
Component: contrib.postgres | Version: master
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
----------------------------------+--------------------------------------
Changes (by Suor):

* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0


Comment:

Created a failing test in a pull request
https://github.com/django/django/pull/2853

--
Ticket URL: <https://code.djangoproject.com/ticket/22907#comment:1>

Django

unread,
Jun 26, 2014, 7:47:57 AM6/26/14
to django-...@googlegroups.com
#22907: ArrayField querying doesn't work with CharField
----------------------------------+------------------------------------

Reporter: Suor | Owner:
Type: Bug | Status: new
Component: contrib.postgres | Version: master
Severity: Release blocker | 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 charettes):

* stage: Unreviewed => Accepted


Comment:

I could reproduce with provided test case on PostgreSQL 9.3.4.

Interestingly I'm also getting a failure on
`postgres_tests.test_array.TestSaveLoad.test_dates`:

{{{
ProgrammingError: column "field" is of type timestamp with time zone[] but
expression is of type text[]
LINE 1: ...tgres_tests_datetimearraymodel" ("field") VALUES (ARRAY['201...
^
HINT: You will need to rewrite or cast the expression.
}}}

@Suor Which version of PostgreSQL are you using?

--
Ticket URL: <https://code.djangoproject.com/ticket/22907#comment:2>

Django

unread,
Jun 26, 2014, 3:47:34 PM6/26/14
to django-...@googlegroups.com
#22907: ArrayField querying doesn't work with CharField
----------------------------------+------------------------------------

Reporter: Suor | 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
----------------------------------+------------------------------------
Changes (by aaugustin):

* severity: Release blocker => Normal


Comment:

This ticket doesn't block 1.7, probably doesn't block 1.8, and will most
likely be fixed by then.

--
Ticket URL: <https://code.djangoproject.com/ticket/22907#comment:3>

Django

unread,
Jul 15, 2014, 7:49:56 AM7/15/14
to django-...@googlegroups.com
#22907: ArrayField querying doesn't work with CharField
----------------------------------+------------------------------------

Reporter: Suor | Owner:
Type: Bug | Status: new
Component: contrib.postgres | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
----------------------------------+------------------------------------
Changes (by mjtamlyn):

* has_patch: 0 => 1


Comment:

PR: https://github.com/django/django/pull/2924

--
Ticket URL: <https://code.djangoproject.com/ticket/22907#comment:4>

Django

unread,
Jul 15, 2014, 8:00:06 AM7/15/14
to django-...@googlegroups.com
#22907: ArrayField querying doesn't work with CharField
-------------------------------------+-------------------------------------

Reporter: Suor | Owner:
Type: Bug | Status: new
Component: contrib.postgres | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
Has patch: 1 | checkin
Needs tests: 0 | Needs documentation: 0
Easy pickings: 0 | Patch needs improvement: 0
| UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timo):

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/22907#comment:5>

Django

unread,
Jul 15, 2014, 2:42:05 PM7/15/14
to django-...@googlegroups.com
#22907: ArrayField querying doesn't work with CharField
-------------------------------------+-------------------------------------
Reporter: Suor | Owner: Marc
Type: Bug | Tamlyn <marc.tamlyn@…>
Component: contrib.postgres | Status: closed
Severity: Normal | Version: master
Keywords: | Resolution: fixed
Has patch: 1 | Triage Stage: Ready for
Needs tests: 0 | checkin
Easy pickings: 0 | Needs documentation: 0

| Patch needs improvement: 0
| UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Marc Tamlyn <marc.tamlyn@…>):

* owner: => Marc Tamlyn <marc.tamlyn@…>
* status: new => closed
* resolution: => fixed


Comment:

In [changeset:"b65a2001e7be3811903fc8769fa4d3df3d324f18"]:
{{{
#!CommitTicketReference repository=""
revision="b65a2001e7be3811903fc8769fa4d3df3d324f18"
Fixed #22907 -- Array contains must have same type.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/22907#comment:6>

Reply all
Reply to author
Forward
0 new messages