Opened 6 months ago
Closed 10 hours ago
#36277 closed New feature (fixed)
Add GeneratedField(db_persist=False) support on PostgreSQL 18+
Reported by: | Adam Johnson | Owned by: | arsalan64 |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | David Sanders, JaeHyuckSa, Ahmed Ibrahim | Triage Stage: | Ready for checkin |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
PostgreSQL 18, expected late 2025, 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
Change History (13)
comment:1 by , 6 months ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 6 months ago
Triage Stage: | Accepted → Someday/Maybe |
---|
comment:3 by , 6 months ago
Cc: | added |
---|
comment:4 by , 6 months ago
Cc: | added |
---|
comment:5 by , 2 months ago
Cc: | added |
---|
comment:6 by , 3 days ago
Triage Stage: | Someday/Maybe → Accepted |
---|
It came out yesterday: https://www.postgresql.org/about/news/postgresql-18-released-3142/
I think we can start working on this now.
comment:7 by , 2 days ago
Owner: | set to |
---|---|
Status: | new → assigned |
Self-assigning so I can start working on this
comment:8 by , 2 days ago
Has patch: | set |
---|
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)
comment:9 by , 2 days ago
Patch needs improvement: | set |
---|
Nope, flipping the feature switch on 18+ should be enough. The documentation should mention that virtual columns are only supported on 18+ though.
comment:10 by , 2 days ago
I have updated the documentation to mention version 18+ for virtual columns.
comment:12 by , 11 hours ago
Triage Stage: | Accepted → Ready for checkin |
---|
Going to update to "Someday/Maybe" until PostgreSQL 18 is available.