diff options
Diffstat (limited to 'django')
| -rw-r--r-- | django/contrib/postgres/search.py | 1 | ||||
| -rw-r--r-- | django/db/backends/postgresql/features.py | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/django/contrib/postgres/search.py b/django/contrib/postgres/search.py index 08d92e3514..c3b940d436 100644 --- a/django/contrib/postgres/search.py +++ b/django/contrib/postgres/search.py @@ -134,6 +134,7 @@ class SearchQuery(SearchQueryCombinable, Value): 'plain': 'plainto_tsquery', 'phrase': 'phraseto_tsquery', 'raw': 'to_tsquery', + 'websearch': 'websearch_to_tsquery', } def __init__(self, value, output_field=None, *, config=None, invert=False, search_type='plain'): diff --git a/django/db/backends/postgresql/features.py b/django/db/backends/postgresql/features.py index 58b16d2b48..fad87081b0 100644 --- a/django/db/backends/postgresql/features.py +++ b/django/db/backends/postgresql/features.py @@ -65,10 +65,15 @@ class DatabaseFeatures(BaseDatabaseFeatures): return self.connection.pg_version >= 100000 @cached_property + def is_postgresql_11(self): + return self.connection.pg_version >= 110000 + + @cached_property def is_postgresql_12(self): return self.connection.pg_version >= 120000 has_bloom_index = property(operator.attrgetter('is_postgresql_9_6')) has_brin_autosummarize = property(operator.attrgetter('is_postgresql_10')) has_phraseto_tsquery = property(operator.attrgetter('is_postgresql_9_6')) + has_websearch_to_tsquery = property(operator.attrgetter('is_postgresql_11')) supports_table_partitions = property(operator.attrgetter('is_postgresql_10')) |
