]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Support VIRTUAL computed columns on PostgreSQL.
authorFederico Caselli <cfederico87@gmail.com>
Mon, 6 Oct 2025 19:39:10 +0000 (21:39 +0200)
committerMichael Bayer <mike_mp@zzzcomputing.com>
Tue, 14 Oct 2025 21:21:30 +0000 (21:21 +0000)
commit8d560a0aa522c4cf8518698c44ea842c2640190a
treed23c7be5e5014e301f820bd03ec70d876f553c06
parent1a2d5cb8518e0b2ce81b2368e16fb470c27389be
Support VIRTUAL computed columns on PostgreSQL.

Support for ``VIRTUAL`` computed columns on PostgreSQL 18 and later has
been added. The default behavior when :paramref:`.Computed.persisted` is
not specified has been changed to align with PostgreSQL 18's default of
``VIRTUAL``. When :paramref:`.Computed.persisted` is not specified, no
keyword is rendered on PostgreSQL 18 and later; on older versions a
warning is emitted and ``STORED`` is used as the default. To explicitly
request ``STORED`` behavior on all PostgreSQL versions, specify
``persisted=True``.

Fixes: #12866
Change-Id: Ic2ebdbe79e230a88370cf2b3503d2d1815f72a39
doc/build/changelog/unreleased_21/12866.rst [new file with mode: 0644]
doc/build/core/defaults.rst
lib/sqlalchemy/dialects/postgresql/base.py
test/dialect/postgresql/test_compiler.py
test/orm/dml/test_bulk_statements.py
test/requirements.py