mirror of
https://github.com/django/django.git
synced 2025-08-03 18:38:50 +00:00
Fixed #35586 -- Added support for set-returning database functions.
Aggregation optimization didn't account for not referenced set-returning annotations on Postgres. Co-authored-by: Simon Charette <charette.s@gmail.com>
This commit is contained in:
parent
228128618b
commit
e03083917d
6 changed files with 54 additions and 0 deletions
|
@ -1095,6 +1095,16 @@ calling the appropriate methods on the wrapped expression.
|
|||
:py:data:`NotImplemented` which forces the expression to be computed on
|
||||
the database.
|
||||
|
||||
.. attribute:: set_returning
|
||||
|
||||
.. versionadded:: 5.2
|
||||
|
||||
Tells Django that this expression contains a set-returning function,
|
||||
enforcing subquery evaluation. It's used, for example, to allow some
|
||||
Postgres set-returning functions (e.g. ``JSONB_PATH_QUERY``,
|
||||
``UNNEST``, etc.) to skip optimization and be properly evaluated when
|
||||
annotations spawn rows themselves. Defaults to ``False``.
|
||||
|
||||
.. method:: resolve_expression(query=None, allow_joins=True, reuse=None, summarize=False, for_save=False)
|
||||
|
||||
Provides the chance to do any preprocessing or validation of
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue