Opened 6 years ago

Last modified 18 hours ago

#30200 assigned New feature

Add support for using indexes in update() for ArrayFields.

Reported by: Mariusz Felisiak Owned by: Jacob1507
Component: contrib.postgres Version: dev
Severity: Normal Keywords: ArrayField PostreSQL index update
Cc: Ülgen Sarıkavak, Bhuvnesh Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no
Pull Requests:19166 build:success, 11712 unmerged

Description

Django supports index lookup for ArrayFields (see docs). I think we should support them also in update(), e.g.

Foo.objects.update(bar_array_field__0='random text')
Foo.objects.update(bar_array_field__0=F('other_related_field'))

I know that 3rd party packages already support this e.g. django_postgres_extensions, but IMO we should add this to Django.

According to the ticket's flags, the next step(s) to move this issue forward are:

  • For anyone except the patch author to review the patch using the patch review checklist and either mark the ticket as "Ready for checkin" if everything looks good, or leave comments for improvement and mark the ticket as "Patch needs improvement".

Change History (11)

comment:1 by Carlton Gibson, 6 years ago

Triage Stage: UnreviewedAccepted

OK. Seems reasonable.

comment:2 by Tim Graham, 6 years ago

See also #24709 for using QuerySet.update() without indexes.

comment:3 by Nasir Hussain, 5 years ago

Owner: set to Nasir Hussain
Status: newassigned

comment:4 by Nasir Hussain, 5 years ago

Has patch: set

Created a PR.

comment:5 by Mariusz Felisiak, 5 years ago

Patch needs improvement: set

comment:6 by Abhyudai, 4 years ago

Has patch: unset
Owner: changed from Nasir Hussain to Abhyudai
Patch needs improvement: unset

comment:7 by Mariusz Felisiak, 3 years ago

Owner: Abhyudai removed
Status: assignednew

comment:8 by Ülgen Sarıkavak, 11 months ago

Cc: Ülgen Sarıkavak added

comment:9 by Bhuvnesh, 7 months ago

Cc: Bhuvnesh added

comment:10 by Jacob1507, 6 days ago

Owner: set to Jacob1507
Status: newassigned

comment:11 by Jacob Walls, 18 hours ago

Has patch: set
Note: See TracTickets for help on using tickets.
Back to Top