Opened 16 months ago

Closed 10 months ago

Last modified 2 weeks 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 (15)

comment:1 by Simon Charette, 16 months ago

Triage Stage: UnreviewedAccepted

comment:2 by Sarah Boyce, 16 months ago

Triage Stage: AcceptedSomeday/Maybe

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

comment:3 by David Sanders, 16 months ago

Cc: David Sanders added

comment:4 by JaeHyuckSa, 16 months ago

Cc: JaeHyuckSa added

comment:5 by Ahmed Ibrahim, 12 months ago

Cc: Ahmed Ibrahim added

comment:6 by Adam Johnson, 10 months 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, 10 months ago

Owner: set to arsalan64
Status: newassigned

Self-assigning so I can start working on this

comment:8 by arsalan64, 10 months ago

Has patch: set

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

In your opinion should we add or edit test cases for this change ? (Personally I think the tests already present are enough)

Last edited 10 months ago by arsalan64 (previous) (diff)

comment:9 by Simon Charette, 10 months 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, 10 months ago

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

comment:11 by Simon Charette, 10 months ago

Patch needs improvement: unset

Thank you!

comment:12 by Mariusz Felisiak, 10 months ago

Triage Stage: AcceptedReady for checkin

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

Resolution: fixed
Status: assignedclosed

In e8190b37:

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

comment:14 by GitHub <noreply@…>, 2 weeks ago

In 8c454124:

Refs #36277 -- Added release note for Postgres 18+ virtual column.

comment:15 by Mariusz Felisiak <felisiak.mariusz@…>, 2 weeks ago

In 684b9fb6:

[6.1.x] Refs #36277 -- Added release note for Postgres 18+ virtual column.

Backport of 8c454124cdbe4a286b02f5b3ff7d01adcb9d9b32 from main

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