diff --git a/django/db/backends/postgresql/features.py b/django/db/backends/postgresql/features.py index 907ba136fb..5e7c99510d 100644 --- a/django/db/backends/postgresql/features.py +++ b/django/db/backends/postgresql/features.py @@ -64,6 +64,10 @@ class DatabaseFeatures(BaseDatabaseFeatures): def is_postgresql_10(self): return self.connection.pg_version >= 100000 + @cached_property + def is_postgresql_12(self): + return self.connection.pg_version >= 120000 + has_brin_autosummarize = property(operator.attrgetter('is_postgresql_10')) has_phraseto_tsquery = property(operator.attrgetter('is_postgresql_9_6')) supports_table_partitions = property(operator.attrgetter('is_postgresql_10')) diff --git a/tests/queries/test_explain.py b/tests/queries/test_explain.py index 60fce96be3..85e173bf3f 100644 --- a/tests/queries/test_explain.py +++ b/tests/queries/test_explain.py @@ -58,6 +58,8 @@ class ExplainTests(TestCase): ] if connection.features.is_postgresql_10: test_options.append({'summary': True}) + if connection.features.is_postgresql_12: + test_options.append({'settings': True}) for options in test_options: with self.subTest(**options), transaction.atomic(): with CaptureQueriesContext(connection) as captured_queries: