Opened 11 years ago
Closed 11 years ago
#22907 closed Bug (fixed)
ArrayField querying doesn't work with CharField
| Reported by: | Alexander Schepanovski | Owned by: | |
|---|---|---|---|
| Component: | contrib.postgres | Version: | dev |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Ready for checkin | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
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.
Change History (6)
comment:1 by , 11 years ago
comment:2 by , 11 years ago
| Triage Stage: | Unreviewed → Accepted |
|---|
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?
comment:3 by , 11 years ago
| Severity: | Release blocker → Normal |
|---|
This ticket doesn't block 1.7, probably doesn't block 1.8, and will most likely be fixed by then.
comment:5 by , 11 years ago
| Triage Stage: | Accepted → Ready for checkin |
|---|
comment:6 by , 11 years ago
| Owner: | set to |
|---|---|
| Resolution: | → fixed |
| Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
Created a failing test in a pull request https://github.com/django/django/pull/2853