[Django] #36377: support `hints` for postgres contrib operations

18 views
Skip to first unread message

Django

unread,
May 8, 2025, 12:46:06 PMMay 8
to django-...@googlegroups.com
#36377: support `hints` for postgres contrib operations
---------------------------------+-----------------------------------------
Reporter: anthony sottile | Type: New feature
Status: new | Component: Uncategorized
Version: 5.2 | 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
---------------------------------+-----------------------------------------
since they are ~effectively specialized `RunSql` operations it would be
nice if they support `hints=...` as well. at sentry we utilize this in
our database router to properly target sql-like operations during
migrations. without hints we don't know what database to apply the
migration operation to

something like:

```python
operations = [BtreeGistExtension(hints={'tables': ['sentry_whatever']})]
```

(and updating the `allow_migrate(...)` calls inside `CreateExtension`)
--
Ticket URL: <https://code.djangoproject.com/ticket/36377>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
May 8, 2025, 12:55:54 PMMay 8
to django-...@googlegroups.com
#36377: support `hints` for postgres contrib operations
---------------------------------+--------------------------------------
Reporter: anthony sottile | Owner: (none)
Type: New feature | Status: new
Component: Uncategorized | Version: 5.2
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 anthony sottile:

Old description:

> since they are ~effectively specialized `RunSql` operations it would be
> nice if they support `hints=...` as well. at sentry we utilize this in
> our database router to properly target sql-like operations during
> migrations. without hints we don't know what database to apply the
> migration operation to
>
> something like:
>
> ```python
> operations = [BtreeGistExtension(hints={'tables': ['sentry_whatever']})]
> ```
>
> (and updating the `allow_migrate(...)` calls inside `CreateExtension`)

New description:

since they are ~effectively specialized `RunSql` operations it would be
nice if they support `hints=...` as well. at sentry we utilize this in
our database router to properly target sql-like operations during
migrations. without hints we don't know what database to apply the
migration operation to

something like:

{{{
operations = [BtreeGistExtension(hints={'tables': ['sentry_whatever']})]
}}}

(and updating the `allow_migrate(...)` calls inside `CreateExtension`)

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

Django

unread,
May 8, 2025, 1:23:32 PMMay 8
to django-...@googlegroups.com
#36377: support `hints` for postgres contrib operations
---------------------------------+------------------------------------
Reporter: anthony sottile | Owner: (none)
Type: New feature | Status: new
Component: Migrations | Version: 5.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
---------------------------------+------------------------------------
Changes (by Simon Charette):

* component: Uncategorized => Migrations
* easy: 0 => 1
* stage: Unreviewed => Accepted

Comment:

That makes sense.
--
Ticket URL: <https://code.djangoproject.com/ticket/36377#comment:2>

Django

unread,
May 8, 2025, 4:41:26 PMMay 8
to django-...@googlegroups.com
#36377: support `hints` for postgres contrib operations
---------------------------------+------------------------------------
Reporter: anthony sottile | Owner: (none)
Type: New feature | Status: new
Component: Migrations | Version: 5.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
---------------------------------+------------------------------------
Changes (by anthony sottile):

* has_patch: 0 => 1

Comment:

https://github.com/django/django/19454
--
Ticket URL: <https://code.djangoproject.com/ticket/36377#comment:3>

Django

unread,
May 8, 2025, 6:14:20 PMMay 8
to django-...@googlegroups.com
#36377: support `hints` for postgres contrib operations
-------------------------------------+-------------------------------------
Reporter: anthony sottile | Owner: Anthony
| Sottile
Type: New feature | Status: assigned
Component: Migrations | Version: 5.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Simon Charette):

* owner: (none) => Anthony Sottile
* status: new => assigned

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

Django

unread,
May 16, 2025, 3:54:11 AMMay 16
to django-...@googlegroups.com
#36377: support `hints` for postgres contrib operations
-------------------------------------+-------------------------------------
Reporter: anthony sottile | Owner: Anthony
| Sottile
Type: New feature | Status: assigned
Component: Migrations | Version: 5.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

* needs_docs: 0 => 1

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

Django

unread,
Jul 20, 2025, 8:49:53 AMJul 20
to django-...@googlegroups.com
#36377: support `hints` for postgres contrib operations
-------------------------------------+-------------------------------------
Reporter: anthony sottile | Owner: Anthony
| Sottile
Type: New feature | Status: assigned
Component: Migrations | Version: 5.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Anthony Sottile):

* needs_docs: 1 => 0

Comment:

updating the "Needs documentation" box as I believe I have addressed the
docs updates requested in [https://github.com/django/django/pull/19454 the
PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/36377#comment:6>

Django

unread,
Jul 21, 2025, 4:48:27 PMJul 21
to django-...@googlegroups.com
#36377: support `hints` for postgres contrib operations
-------------------------------------+-------------------------------------
Reporter: anthony sottile | Owner: Anthony
| Sottile
Type: New feature | Status: assigned
Component: Migrations | Version: 5.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* stage: Accepted => Ready for checkin

--
Ticket URL: <https://code.djangoproject.com/ticket/36377#comment:7>

Django

unread,
Jul 22, 2025, 5:57:08 AMJul 22
to django-...@googlegroups.com
#36377: support `hints` for postgres contrib operations
-------------------------------------+-------------------------------------
Reporter: anthony sottile | Owner: Anthony
| Sottile
Type: New feature | Status: closed
Component: Migrations | Version: 5.2
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: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

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

Comment:

In [changeset:"5488530a272b863794484ee2b027294ff2ec86d2" 5488530a]:
{{{#!CommitTicketReference repository=""
revision="5488530a272b863794484ee2b027294ff2ec86d2"
Fixed #36377 -- Added hints support to CreateExtension and subclasses.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36377#comment:8>
Reply all
Reply to author
Forward
0 new messages