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 Simon Charette, 6 months ago

Triage Stage: UnreviewedAccepted

comment:2 by Sarah Boyce, 6 months ago

Triage Stage: AcceptedSomeday/Maybe

Going to update to "Someday/Maybe" until PostgreSQL 18 is available.

comment:3 by David Sanders, 6 months ago

Cc: David Sanders added

comment:4 by JaeHyuckSa, 6 months ago

Cc: JaeHyuckSa added

comment:5 by Ahmed Ibrahim, 2 months ago

Cc: Ahmed Ibrahim added

comment:6 by Adam Johnson, 3 days ago

Triage Stage: Someday/MaybeAccepted

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 arsalan64, 2 days ago

Owner: set to arsalan64
Status: newassigned

Self-assigning so I can start working on this

comment:8 by arsalan64, 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)

Version 0, edited 2 days ago by arsalan64 (next)

comment:9 by Simon Charette, 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 arsalan64, 2 days ago

I have updated the documentation to mention version 18+ for virtual columns.

comment:11 by Simon Charette, 2 days ago

Patch needs improvement: unset

Thank you!

comment:12 by Mariusz Felisiak, 11 hours ago

Triage Stage: AcceptedReady for checkin

comment:13 by Mariusz Felisiak <felisiak.mariusz@…>, 10 hours ago

Resolution: fixed
Status: assignedclosed

In e8190b37:

Fixed #36277 -- Fixed DatabaseFeatures.supports_virtual_generated_columns on PostgreSQL 18+.

Note: See TracTickets for help on using tickets.
Back to Top