Opened 4 years ago

Closed 4 years ago

#31709 closed New feature (fixed)

Support operator classes for exclusion constraints.

Reported by: Hannes Ljungberg Owned by: Hannes Ljungberg
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

ExclusionConstraint should allow setting opclasses just like Index:

class Meta:
    constraints = [
        ExclusionConstraint(
            name='exclude_overlapping'',
            expressions=[('circle', RangeOperators.OVERLAPS),
            opclasses=['circle_ops'],
        )
    ]

There are not many choices over the default operator classes on GiST and SP-GiST indexes. I think the only one is for point where one can choose between quad_point_ops and kd_point_ops. But users can also create custom operator classes. I think it makes sense to also provide this option on ExclusionConstraint for consistency.

I've also created https://code.djangoproject.com/ticket/31702 to add opclasses to UniqueConstraint.

Change History (3)

comment:1 by Mariusz Felisiak, 4 years ago

Summary: Allow specifying custom operator classes for PostgreSQL exclusion constraintsSupport operator classes for exclusion constraints.
Triage Stage: UnreviewedAccepted

comment:2 by Hannes Ljungberg, 4 years ago

Has patch: set

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

Resolution: fixed
Status: assignedclosed

In 0d6d4e7:

Fixed #31709 -- Added support for opclasses in ExclusionConstraint.

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