Opened 8 years ago

Closed 8 years ago

#27767 closed New feature (fixed)

Support DISTINCT queries in ArrayAgg

Reported by: Tom Forbes Owned by: Tim Graham <timograham@…>
Component: contrib.postgres Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

It's sometimes useful to run DISTINCT over an ArrayAgg, I've made a rather simple pull request that implements this here: https://github.com/django/django/pull/7932

I notice there are a few aggregates now that support Distinct (Count, StringAgg and hopefully ArrayAgg). It might be good to make a subclass they inherit from, instead of duplicating the implementation?

If this is deemed a good idea I can add some documentation changes and any changes that are requested.

Change History (4)

comment:1 by Simon Charette, 8 years ago

Has patch: set
Needs documentation: set
Triage Stage: UnreviewedAccepted

I notice there are a few aggregates now that support Distinct (Count, StringAgg and hopefully ArrayAgg). It might be good to make a subclass they inherit from, instead of duplicating the implementation?

Makes sense to me.

comment:2 by Simon Charette, 8 years ago

Patch needs improvement: set

comment:3 by Tom Forbes, 8 years ago

Needs documentation: unset
Patch needs improvement: unset

comment:4 by Tim Graham <timograham@…>, 8 years ago

Owner: set to Tim Graham <timograham@…>
Resolution: fixed
Status: newclosed

In b5393028:

Fixed #27767 -- Added distinct argument to ArrayAgg.

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