[Django] #33665: Add support for Postgres multirange

44 views
Skip to first unread message

Django

unread,
Apr 27, 2022, 7:29:01 AM4/27/22
to django-...@googlegroups.com
#33665: Add support for Postgres multirange
--------------------------------------------+------------------------
Reporter: Tom Carrick | Owner: (none)
Type: New feature | Status: new
Component: contrib.postgres | Version: dev
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
--------------------------------------------+------------------------
Postgres 14 adds various multirange data types corresponding to the
existing range types: https://www.postgresql.org/docs/14/rangetypes.html

e.g.:


{{{
select nummultirange(numrange(null, 2), numrange(4, 5), numrange(8, 9));
}}}

Gives `"{(,2),[4,5),[8,9)}"`.


I would like to have some support for these in Django.

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

Django

unread,
Apr 27, 2022, 7:33:14 AM4/27/22
to django-...@googlegroups.com
#33665: Add support for Postgres multirange
----------------------------------+--------------------------------------

Reporter: Tom Carrick | Owner: (none)
Type: New feature | Status: new
Component: contrib.postgres | Version: dev
Severity: Normal | Resolution:

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
----------------------------------+--------------------------------------
Description changed by Tom Carrick:

Old description:

> Postgres 14 adds various multirange data types corresponding to the
> existing range types: https://www.postgresql.org/docs/14/rangetypes.html
>
> e.g.:
>

> {{{
> select nummultirange(numrange(null, 2), numrange(4, 5), numrange(8, 9));
> }}}
>
> Gives `"{(,2),[4,5),[8,9)}"`.
>

> I would like to have some support for these in Django.

New description:

Postgres 14 adds various multirange data types corresponding to the
existing range types: https://www.postgresql.org/docs/14/rangetypes.html

e.g.:


{{{
select nummultirange(numrange(null, 2), numrange(4, 5), numrange(8, 9));
}}}

Gives `"{(,2),[4,5),[8,9)}"`.


I would like to have some support for these in Django.

One use case: an app that finds time for meetings. Each user submits
ranges of times they're available on a calendar and the app suggests times
that works for everyone / the most people.

--

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

Django

unread,
Apr 27, 2022, 2:31:06 PM4/27/22
to django-...@googlegroups.com
#33665: Add support for Postgres multirange
----------------------------------+------------------------------------
Reporter: Tom Carrick | Owner: (none)
Type: New feature | Status: new
Component: contrib.postgres | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

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

* stage: Unreviewed => Accepted


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

Django

unread,
May 2, 2022, 5:14:08 AM5/2/22
to django-...@googlegroups.com
#33665: Add support for Postgres multirange
----------------------------------+------------------------------------
Reporter: Tom Carrick | Owner: (none)
Type: New feature | Status: new
Component: contrib.postgres | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
----------------------------------+------------------------------------

Comment (by Tom Carrick):

I just found https://code.djangoproject.com/ticket/33238 for this issue
but closed as wontfix. I didn't find it the first time because I searched
for "multirange" rather than "multi range".

Anyway I do think this can be implemented without too much of a
maintenance burden. I have some ideas on the implementation but I haven't
thought about it too closely.

I just wanted to add this because I didn't see the original ticket so I'm
not sure if this one should be closed as well.

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

Django

unread,
May 2, 2022, 5:22:52 AM5/2/22
to django-...@googlegroups.com
#33665: Add support for Postgres multirange
----------------------------------+--------------------------------------

Reporter: Tom Carrick | Owner: (none)
Type: New feature | Status: closed
Component: contrib.postgres | Version: dev
Severity: Normal | Resolution: duplicate
Keywords: | Triage Stage: Unreviewed

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

* status: new => closed
* resolution: => duplicate
* stage: Accepted => Unreviewed


Comment:

Thanks! I had a gut feeling that I'd seen it already 🤦. Let's close it as
a duplicate of #33238. Please leave a comment in the original ticket. We
can reopen it if you provides PoC that is maintainable.

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

Reply all
Reply to author
Forward
0 new messages