Opened 3 years ago

Closed 3 years ago

#32961 closed New feature (fixed)

Add support for BIT_XOR aggregate in PostgreSQL 14+.

Reported by: Nick Pope Owned by: Nick Pope
Component: contrib.postgres Version: dev
Severity: Normal Keywords: postgresql, aggregate, bit_xor
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

PostgreSQL 14+ will support a BIT_XOR aggregate function. We already support BIT_AND and BIT_OR in django.contrib.postgres.

See ​https://www.postgresql.org/docs/release/14.0/


As an aside, it looks as though Oracle 21c supports these as BIT_AND_AGG, BIT_OR_AGG, and BIT_XOR_AGG.
They're also supported in MySQL and MariaDB, but when there are no rows to aggregate they don't return NULL.
It's relative straightforward to register custom aggregates for SQLite for these too.
Perhaps there might be a case to migrate these to django.db.models.aggregates in the future...

Change History (5)

comment:1 by Nick Pope, 3 years ago

Triage Stage: UnreviewedSomeday/Maybe

Changing the triage status based on PostgreSQL 14 still being in beta, as has been done for #32943.

comment:2 by Nick Pope, 3 years ago

Has patch: set

Draft PR pending this being accepted.

PostgreSQL 14 should be released in late September or early October based on the last five major releases.
Django 4.0 feature freeze is scheduled for 20th September with final release on 6th December.

If all goes well we could perhaps consider landing this before the feature freeze when a PostgreSQL 14 release candidate is available.

comment:3 by Mariusz Felisiak, 3 years ago

Triage Stage: Someday/MaybeAccepted

PostgreSQL 14 is released.

comment:4 by Mariusz Felisiak, 3 years ago

Triage Stage: AcceptedReady for checkin
Version: 3.2dev

comment:5 by Mariusz Felisiak <felisiak.mariusz@…>, 3 years ago

Resolution: fixed
Status: assignedclosed

In bd47b9bc:

Fixed #32961 -- Added BitXor() aggregate to django.contrib.postgres.

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