diff options
Diffstat (limited to 'django/db/backends/postgresql/features.py')
-rw-r--r-- | django/db/backends/postgresql/features.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/django/db/backends/postgresql/features.py b/django/db/backends/postgresql/features.py index e70ef4e95d..7615c2b4c3 100644 --- a/django/db/backends/postgresql/features.py +++ b/django/db/backends/postgresql/features.py @@ -58,10 +58,16 @@ class DatabaseFeatures(BaseDatabaseFeatures): supports_deferrable_unique_constraints = True has_json_operators = True json_key_contains_list_matching_requires_list = True - test_collations = { - 'non_default': 'sv-x-icu', - 'swedish_ci': 'sv-x-icu', - } + + @cached_property + def test_collations(self): + # PostgreSQL < 10 doesn't support ICU collations. + if self.is_postgresql_10: + return { + 'non_default': 'sv-x-icu', + 'swedish_ci': 'sv-x-icu', + } + return {} @cached_property def introspected_field_types(self): |