#33342 closed New feature (fixed)
Allow ExclusionConstraint to use the OpClass expression
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
To bring ExclusionConstraint
in line with Index
and UniqueConstraint
I think we should allow usage of the OpClass expressions. To support this we would make ExclusionConstraint
use the DDL reference classes instead of a templated SQL string plus usage of the IndexExpression
class.
Change History (6)
comment:1 by , 3 years ago
Has patch: | set |
---|
comment:2 by , 3 years ago
Triage Stage: | Unreviewed → Accepted |
---|
Sounds reasonable, maybe we should also deprecate the opclasses
argument.
comment:3 by , 3 years ago
Sounds reasonable, maybe we should also deprecate the opclasses argument.
Yup, that sounds like the proper way forward.
As a side note it would be interesting to look into the possibility of deprecating the fields
argument (and by that the opclasses
argument) on Index
and UniqueConstraint
. It would require us to make Index.contains_expressions
and UniqueConstraint.contains_expressions
a bit smarter.
PR: https://github.com/django/django/pull/15162