summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
Diffstat (limited to 'django')
-rw-r--r--django/db/models/expressions.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/django/db/models/expressions.py b/django/db/models/expressions.py
index 6afe68bac0..ccb67876e2 100644
--- a/django/db/models/expressions.py
+++ b/django/db/models/expressions.py
@@ -7,6 +7,7 @@ from django.core.exceptions import EmptyResultSet, FieldError
from django.db import connection
from django.db.models import fields
from django.db.models.query_utils import Q
+from django.db.utils import NotSupportedError
from django.utils.deconstruct import deconstructible
from django.utils.functional import cached_property
from django.utils.hashable import make_hashable
@@ -1237,6 +1238,8 @@ class Window(Expression):
def as_sql(self, compiler, connection, template=None):
connection.ops.check_expression_support(self)
+ if not connection.features.supports_over_clause:
+ raise NotSupportedError('This backend does not support window expressions.')
expr_sql, params = compiler.compile(self.source_expression)
window_sql, window_params = [], []