#30332 closed Bug (fixed)
Postgres ordering ARRAY_AGG and STRING_AGG do not support expression.
| Reported by: | Simone Pellizzari | Owned by: | Simone Pellizzari |
|---|---|---|---|
| Component: | Database layer (models, ORM) | Version: | 2.2 |
| Severity: | Release blocker | Keywords: | postgres string_agg array_agg ordering order by |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description (last modified by )
I found that if you pass and expression as an ordering argument (introduced in https://github.com/django/django/commit/96199e562dcc409ab4bdc2b2146fa7cf73c7c5fe) an IndexError: tuple index out of range exception will be thrown when the query is executed.
This is caused by simply ignoring sql_params returned from as_sql calls on expressions contained built from ordering argument.
Change History (9)
comment:1 by , 7 years ago
| Description: | modified (diff) |
|---|
comment:2 by , 7 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
comment:3 by , 7 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
comment:4 by , 7 years ago
| Description: | modified (diff) |
|---|
comment:5 by , 7 years ago
| Resolution: | fixed |
|---|---|
| Status: | closed → new |
Ahem, just wanted to marked as resolved by linked pull request...didn't really want to close :-)
comment:6 by , 7 years ago
| Status: | new → assigned |
|---|
comment:7 by , 7 years ago
| Severity: | Normal → Release blocker |
|---|---|
| Triage Stage: | Unreviewed → Accepted |
Marked as a release blocker because it is a bug in a new feature introduced in Django 2.2.
Opened a pull request that solves this: https://github.com/django/django/pull/11172