Opened 6 years ago

Last modified 4 months ago

#30200 new New feature

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

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

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.

Change History (9)

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, 3 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, 8 months ago

Cc: Ülgen Sarıkavak added

comment:9 by Bhuvnesh, 4 months ago

Cc: Bhuvnesh added
Note: See TracTickets for help on using tickets.
Back to Top