[Django] #33342: Allow ExclusionConstraint to use the OpClass expression

1 view
Skip to first unread message

Django

unread,
Dec 6, 2021, 3:05:33 PM12/6/21
to django-...@googlegroups.com
#33342: Allow ExclusionConstraint to use the OpClass expression
-------------------------------------+-------------------------------------
Reporter: Hannes | Owner: Hannes Ljungberg
Ljungberg |
Type: New | Status: assigned
feature |
Component: | Version: dev
contrib.postgres |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
To bring `ExclusionConstraint` in line with `Index` and `UniqueConstraint`
I think we should allow usage of the
[https://docs.djangoproject.com/en/3.2/ref/contrib/postgres/indexes
/#opclass-expressions 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.

--
Ticket URL: <https://code.djangoproject.com/ticket/33342>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Dec 6, 2021, 7:46:22 PM12/6/21
to django-...@googlegroups.com
#33342: Allow ExclusionConstraint to use the OpClass expression
-------------------------------------+-------------------------------------
Reporter: Hannes Ljungberg | Owner: Hannes
| Ljungberg
Type: New feature | Status: assigned
Component: contrib.postgres | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Hannes Ljungberg):

> 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.

--
Ticket URL: <https://code.djangoproject.com/ticket/33342#comment:3>

Django

unread,
Dec 6, 2021, 8:10:00 PM12/6/21
to django-...@googlegroups.com
#33342: Allow ExclusionConstraint to use the OpClass expression
-------------------------------------+-------------------------------------
Reporter: Hannes Ljungberg | Owner: Hannes
| Ljungberg
Type: New feature | Status: assigned
Component: contrib.postgres | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Hannes Ljungberg):

* has_patch: 0 => 1


Comment:

PR: https://github.com/django/django/pull/15162

--
Ticket URL: <https://code.djangoproject.com/ticket/33342#comment:1>

Django

unread,
Dec 6, 2021, 8:21:47 PM12/6/21
to django-...@googlegroups.com
#33342: Allow ExclusionConstraint to use the OpClass expression
-------------------------------------+-------------------------------------
Reporter: Hannes Ljungberg | Owner: Hannes
| Ljungberg
Type: New feature | Status: assigned
Component: contrib.postgres | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* stage: Unreviewed => Accepted


Comment:

Sounds reasonable, maybe we should also deprecate the `opclasses`
argument.

--
Ticket URL: <https://code.djangoproject.com/ticket/33342#comment:2>

Django

unread,
Dec 24, 2021, 6:56:03 AM12/24/21
to django-...@googlegroups.com
#33342: Allow ExclusionConstraint to use the OpClass expression
-------------------------------------+-------------------------------------
Reporter: Hannes Ljungberg | Owner: Hannes
| Ljungberg
Type: New feature | Status: closed
Component: contrib.postgres | Version: dev
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"0e656c02fe945389246f0c08f51c6db4a0849bd2" 0e656c02]:
{{{
#!CommitTicketReference repository=""
revision="0e656c02fe945389246f0c08f51c6db4a0849bd2"
Fixed #33342 -- Added support for using OpClass() in exclusion
constraints.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33342#comment:4>

Django

unread,
Dec 27, 2021, 12:47:43 PM12/27/21
to django-...@googlegroups.com
#33342: Allow ExclusionConstraint to use the OpClass expression
-------------------------------------+-------------------------------------
Reporter: Hannes Ljungberg | Owner: Hannes
| Ljungberg
Type: New feature | Status: closed
Component: contrib.postgres | Version: dev
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"59a66f05126a4f9622f67ac71ccc149c805a6ccd" 59a66f05]:
{{{
#!CommitTicketReference repository=""
revision="59a66f05126a4f9622f67ac71ccc149c805a6ccd"
Refs #33342 -- Deprecated ExclusionConstraint.opclasses.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33342#comment:5>

Django

unread,
Jan 17, 2023, 5:49:43 AM1/17/23
to django-...@googlegroups.com
#33342: Allow ExclusionConstraint to use the OpClass expression
-------------------------------------+-------------------------------------
Reporter: Hannes Ljungberg | Owner: Hannes
| Ljungberg
Type: New feature | Status: closed
Component: contrib.postgres | Version: dev
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"23ec318988cb22bef176b9d81e4091715a4f41ff" 23ec3189]:
{{{
#!CommitTicketReference repository=""
revision="23ec318988cb22bef176b9d81e4091715a4f41ff"
Refs #33342 -- Removed ExclusionConstraint.opclasses per deprecation
timeline.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33342#comment:6>

Reply all
Reply to author
Forward
0 new messages