mirror of
https://github.com/django/django.git
synced 2025-10-04 20:39:13 +00:00
Fixed #36277 -- Fixed DatabaseFeatures.supports_virtual_generated_columns on PostgreSQL 18+.
This commit is contained in:
parent
daba609a9b
commit
e8190b370e
@ -67,7 +67,6 @@ class DatabaseFeatures(BaseDatabaseFeatures):
|
|||||||
supports_update_conflicts_with_target = True
|
supports_update_conflicts_with_target = True
|
||||||
supports_covering_indexes = True
|
supports_covering_indexes = True
|
||||||
supports_stored_generated_columns = True
|
supports_stored_generated_columns = True
|
||||||
supports_virtual_generated_columns = False
|
|
||||||
can_rename_index = True
|
can_rename_index = True
|
||||||
test_collations = {
|
test_collations = {
|
||||||
"deterministic": "C",
|
"deterministic": "C",
|
||||||
@ -168,9 +167,16 @@ class DatabaseFeatures(BaseDatabaseFeatures):
|
|||||||
def is_postgresql_17(self):
|
def is_postgresql_17(self):
|
||||||
return self.connection.pg_version >= 170000
|
return self.connection.pg_version >= 170000
|
||||||
|
|
||||||
|
@cached_property
|
||||||
|
def is_postgresql_18(self):
|
||||||
|
return self.connection.pg_version >= 180000
|
||||||
|
|
||||||
supports_unlimited_charfield = True
|
supports_unlimited_charfield = True
|
||||||
supports_nulls_distinct_unique_constraints = property(
|
supports_nulls_distinct_unique_constraints = property(
|
||||||
operator.attrgetter("is_postgresql_15")
|
operator.attrgetter("is_postgresql_15")
|
||||||
)
|
)
|
||||||
|
|
||||||
supports_any_value = property(operator.attrgetter("is_postgresql_16"))
|
supports_any_value = property(operator.attrgetter("is_postgresql_16"))
|
||||||
|
supports_virtual_generated_columns = property(
|
||||||
|
operator.attrgetter("is_postgresql_18")
|
||||||
|
)
|
||||||
|
@ -1302,8 +1302,8 @@ materialized view.
|
|||||||
real column. If ``False``, the column acts as a virtual column and does
|
real column. If ``False``, the column acts as a virtual column and does
|
||||||
not occupy database storage space.
|
not occupy database storage space.
|
||||||
|
|
||||||
PostgreSQL only supports persisted columns. Oracle only supports virtual
|
PostgreSQL < 18 only supports persisted columns. Oracle only supports
|
||||||
columns.
|
virtual columns.
|
||||||
|
|
||||||
.. admonition:: Database limitations
|
.. admonition:: Database limitations
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user