[Django] #36277: Add GeneratedField(db_persist=False) support on PostgreSQL 18+

21 views
Skip to first unread message

Django

unread,
Mar 26, 2025, 9:08:42 AMMar 26
to django-...@googlegroups.com
#36277: Add GeneratedField(db_persist=False) support on PostgreSQL 18+
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Type: New
| feature
Status: new | Component: Database
| layer (models, ORM)
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
-------------------------------------+-------------------------------------
PostgreSQL 18, expected late 2025, [https://www.depesz.com/2025/02/28
/waiting-for-postgresql-18-virtual-generated-columns/ includes virtual
generated column support].

When PostgreSQL 18 is testable, we can update the associated database
feature to a cached property that checks the server version:
https://github.com/django/django/blob/d5c19f9b327fccc1f707e10de648fe9d4cdacb9b/django/db/backends/postgresql/features.py#L76
--
Ticket URL: <https://code.djangoproject.com/ticket/36277>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Mar 26, 2025, 9:52:53 AMMar 26
to django-...@googlegroups.com
#36277: Add GeneratedField(db_persist=False) support on PostgreSQL 18+
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: (none)
Type: New feature | Status: new
Component: Database layer | Version: dev
(models, ORM) |
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 Simon Charette):

* stage: Unreviewed => Accepted

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

Django

unread,
Mar 26, 2025, 10:10:01 AMMar 26
to django-...@googlegroups.com
#36277: Add GeneratedField(db_persist=False) support on PostgreSQL 18+
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: (none)
Type: New feature | Status: new
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Someday/Maybe
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

* stage: Accepted => Someday/Maybe

Comment:

Going to update to "Someday/Maybe" until PostgreSQL 18 is available.
--
Ticket URL: <https://code.djangoproject.com/ticket/36277#comment:2>

Django

unread,
Mar 28, 2025, 5:11:32 AMMar 28
to django-...@googlegroups.com
#36277: Add GeneratedField(db_persist=False) support on PostgreSQL 18+
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: (none)
Type: New feature | Status: new
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Someday/Maybe
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by David Sanders):

* cc: David Sanders (added)

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

Django

unread,
Mar 28, 2025, 7:14:39 AMMar 28
to django-...@googlegroups.com
#36277: Add GeneratedField(db_persist=False) support on PostgreSQL 18+
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: (none)
Type: New feature | Status: new
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Someday/Maybe
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by JaeHyuckSa):

* cc: JaeHyuckSa (added)

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

Django

unread,
Jul 17, 2025, 2:01:34 AMJul 17
to django-...@googlegroups.com
#36277: Add GeneratedField(db_persist=False) support on PostgreSQL 18+
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: (none)
Type: New feature | Status: new
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Someday/Maybe
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Ahmed Ibrahim):

* cc: Ahmed Ibrahim (added)

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

Django

unread,
Sep 26, 2025, 10:35:35 AM (5 days ago) Sep 26
to django-...@googlegroups.com
#36277: Add GeneratedField(db_persist=False) support on PostgreSQL 18+
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: (none)
Type: New feature | Status: new
Component: Database layer | Version: dev
(models, ORM) |
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 Adam Johnson):

* stage: Someday/Maybe => Accepted

Comment:

It came out yesterday:
https://www.postgresql.org/about/news/postgresql-18-released-3142/

I think we can start working on this now.
--
Ticket URL: <https://code.djangoproject.com/ticket/36277#comment:6>

Django

unread,
Sep 27, 2025, 1:09:50 PM (4 days ago) Sep 27
to django-...@googlegroups.com
#36277: Add GeneratedField(db_persist=False) support on PostgreSQL 18+
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: arsalan64
Type: New feature | Status: assigned
Component: Database layer | Version: dev
(models, ORM) |
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 arsalan64):

* owner: (none) => arsalan64
* status: new => assigned

Comment:

Self-assigning so I can start working on this
--
Ticket URL: <https://code.djangoproject.com/ticket/36277#comment:7>

Django

unread,
Sep 27, 2025, 1:56:10 PM (4 days ago) Sep 27
to django-...@googlegroups.com
#36277: Add GeneratedField(db_persist=False) support on PostgreSQL 18+
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: arsalan64
Type: New feature | Status: assigned
Component: Database layer | Version: dev
(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
-------------------------------------+-------------------------------------
Changes (by arsalan64):

* has_patch: 0 => 1

Comment:

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

In your opinion should we add test cases for this change ? (Personally I
think the tests already present are enough)
--
Ticket URL: <https://code.djangoproject.com/ticket/36277#comment:8>

Django

unread,
Sep 27, 2025, 3:41:14 PM (4 days ago) Sep 27
to django-...@googlegroups.com
#36277: Add GeneratedField(db_persist=False) support on PostgreSQL 18+
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: arsalan64
Type: New feature | Status: assigned
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Simon Charette):

* needs_better_patch: 0 => 1

Comment:

Nope, flipping the feature switch on 18+ should be enough. The
documentation should mention that virtual columns are only supported on
18+ though.
--
Ticket URL: <https://code.djangoproject.com/ticket/36277#comment:9>

Django

unread,
Sep 27, 2025, 4:13:24 PM (4 days ago) Sep 27
to django-...@googlegroups.com
#36277: Add GeneratedField(db_persist=False) support on PostgreSQL 18+
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: arsalan64
Type: New feature | Status: assigned
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by arsalan64):

I have updated the documentation to mention version 18+ for virtual
columns.
--
Ticket URL: <https://code.djangoproject.com/ticket/36277#comment:10>

Django

unread,
Sep 27, 2025, 4:17:16 PM (4 days ago) Sep 27
to django-...@googlegroups.com
#36277: Add GeneratedField(db_persist=False) support on PostgreSQL 18+
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: arsalan64
Type: New feature | Status: assigned
Component: Database layer | Version: dev
(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
-------------------------------------+-------------------------------------
Changes (by Simon Charette):

* needs_better_patch: 1 => 0

Comment:

Thank you!
--
Ticket URL: <https://code.djangoproject.com/ticket/36277#comment:11>

Django

unread,
Sep 29, 2025, 4:56:14 AM (2 days ago) Sep 29
to django-...@googlegroups.com
#36277: Add GeneratedField(db_persist=False) support on PostgreSQL 18+
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: arsalan64
Type: New feature | Status: assigned
Component: Database layer | Version: dev
(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 Mariusz Felisiak):

* stage: Accepted => Ready for checkin

--
Ticket URL: <https://code.djangoproject.com/ticket/36277#comment:12>

Django

unread,
Sep 29, 2025, 5:58:17 AM (2 days ago) Sep 29
to django-...@googlegroups.com
#36277: Add GeneratedField(db_persist=False) support on PostgreSQL 18+
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: arsalan64
Type: New feature | Status: closed
Component: Database layer | Version: dev
(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@…>):

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

Comment:

In [changeset:"e8190b370e508648b0f0ee9b86876f97d3997e14" e8190b37]:
{{{#!CommitTicketReference repository=""
revision="e8190b370e508648b0f0ee9b86876f97d3997e14"
Fixed #36277 -- Fixed DatabaseFeatures.supports_virtual_generated_columns
on PostgreSQL 18+.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36277#comment:13>
Reply all
Reply to author
Forward
0 new messages