diff options
| author | arsalan64 <68010697+arsalan64@users.noreply.github.com> | 2025-09-27 19:12:34 +0200 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2025-09-29 10:54:27 +0200 |
| commit | e8190b370e508648b0f0ee9b86876f97d3997e14 (patch) | |
| tree | 3412a5219046967860cf7e44593879a44f6e7eb7 /django/db/backends/postgresql/features.py | |
| parent | daba609a9bdc7a97bcf327c7ba0a5f7b3540b46e (diff) | |
Fixed #36277 -- Fixed DatabaseFeatures.supports_virtual_generated_columns on PostgreSQL 18+.
Diffstat (limited to 'django/db/backends/postgresql/features.py')
| -rw-r--r-- | django/db/backends/postgresql/features.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/django/db/backends/postgresql/features.py b/django/db/backends/postgresql/features.py index 5f63b6c713..23c31c0929 100644 --- a/django/db/backends/postgresql/features.py +++ b/django/db/backends/postgresql/features.py @@ -67,7 +67,6 @@ class DatabaseFeatures(BaseDatabaseFeatures): supports_update_conflicts_with_target = True supports_covering_indexes = True supports_stored_generated_columns = True - supports_virtual_generated_columns = False can_rename_index = True test_collations = { "deterministic": "C", @@ -168,9 +167,16 @@ class DatabaseFeatures(BaseDatabaseFeatures): def is_postgresql_17(self): return self.connection.pg_version >= 170000 + @cached_property + def is_postgresql_18(self): + return self.connection.pg_version >= 180000 + supports_unlimited_charfield = True supports_nulls_distinct_unique_constraints = property( operator.attrgetter("is_postgresql_15") ) supports_any_value = property(operator.attrgetter("is_postgresql_16")) + supports_virtual_generated_columns = property( + operator.attrgetter("is_postgresql_18") + ) |
