[Django] #31702: Allow specifying custom operator classes for PostgreSQL unique indexes

7 views
Skip to first unread message

Django

unread,
Jun 12, 2020, 3:27:45 PM6/12/20
to django-...@googlegroups.com
#31702: Allow specifying custom operator classes for PostgreSQL unique indexes
-------------------------------------+-------------------------------------
Reporter: Hannes | Owner: Hannes Ljungberg
Ljungberg |
Type: New | Status: assigned
feature |
Component: Database | Version: master
layer (models, ORM) |
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 |
-------------------------------------+-------------------------------------
`UniqueConstraint` should allow setting `opclasses` just like `Index`:
{{{
class Meta:
constraints = [
UniqueConstraint(
name='test_ops_class',
fields=['scene'],
opclasses=['varchar_pattern_ops'],
)
]
}}}

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

Django

unread,
Jun 12, 2020, 4:12:10 PM6/12/20
to django-...@googlegroups.com
#31702: Allow specifying custom operator classes for PostgreSQL unique indexes
-------------------------------------+-------------------------------------
Reporter: Hannes Ljungberg | Owner: Hannes
| Ljungberg
Type: New feature | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
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/13059

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

Django

unread,
Jun 15, 2020, 1:22:41 AM6/15/20
to django-...@googlegroups.com
#31702: Support operator classes for unique indexes on PostgreSQL.

-------------------------------------+-------------------------------------
Reporter: Hannes Ljungberg | Owner: Hannes
| Ljungberg
Type: New feature | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
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
-------------------------------------+-------------------------------------

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

Django

unread,
Jun 15, 2020, 2:56:09 AM6/15/20
to django-...@googlegroups.com
#31702: Support operator classes for unique indexes on PostgreSQL.
-------------------------------------+-------------------------------------
Reporter: Hannes Ljungberg | Owner: Hannes
| Ljungberg
Type: New feature | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
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 Alexandr Tatarinov):

Look reasonable to me, the patch is okay, has docs and tests. `Index`
require to provide `name` with `opclasses`, so probably `UniqueConstraint`
should require `name` as well.

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

Django

unread,
Jun 16, 2020, 1:07:34 AM6/16/20
to django-...@googlegroups.com
#31702: Support operator classes for unique indexes on PostgreSQL.
-------------------------------------+-------------------------------------
Reporter: Hannes Ljungberg | Owner: Hannes
| Ljungberg
Type: New feature | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

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

* stage: Accepted => Ready for checkin


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

Django

unread,
Jun 16, 2020, 1:21:12 AM6/16/20
to django-...@googlegroups.com
#31702: Support operator classes for unique indexes on PostgreSQL.
-------------------------------------+-------------------------------------
Reporter: Hannes Ljungberg | Owner: Hannes
| Ljungberg
Type: New feature | Status: closed

Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
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:"7edc6e53a746af995e3b89d53d37938dd8fc46aa" 7edc6e5]:
{{{
#!CommitTicketReference repository=""
revision="7edc6e53a746af995e3b89d53d37938dd8fc46aa"
Fixed #31702 -- Added support for PostgreSQL opclasses in
UniqueConstraint.
}}}

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

Reply all
Reply to author
Forward
0 new messages