Skip to content

Commit

Permalink
Added DatabaseFeatures.is_postgresql_9_5 to avoid repetition.
Browse files Browse the repository at this point in the history
  • Loading branch information
timgraham committed Jan 9, 2018
1 parent d95f1e7 commit d60e8b8
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions django/db/backends/postgresql/features.py
Expand Up @@ -52,17 +52,10 @@ class DatabaseFeatures(BaseDatabaseFeatures):
supports_aggregate_filter_clause = True

@cached_property
def has_select_for_update_skip_locked(self):
def is_postgresql_9_5(self):
return self.connection.pg_version >= 90500

@cached_property
def has_brin_index_support(self):
return self.connection.pg_version >= 90500

@cached_property
def has_jsonb_agg(self):
return self.connection.pg_version >= 90500

@cached_property
def has_gin_pending_list_limit(self):
return self.connection.pg_version >= 90500
has_select_for_update_skip_locked = is_postgresql_9_5
has_brin_index_support = is_postgresql_9_5
has_jsonb_agg = is_postgresql_9_5
has_gin_pending_list_limit = is_postgresql_9_5

0 comments on commit d60e8b8

Please sign in to comment.