From e03083917db03757e48f8edac4c8491b72c8a3c4 Mon Sep 17 00:00:00 2001 From: Devin Cox Date: Fri, 9 Aug 2024 13:56:56 -0700 Subject: 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 --- docs/ref/models/expressions.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'docs/ref') diff --git a/docs/ref/models/expressions.txt b/docs/ref/models/expressions.txt index 1b6a208d01..7833580ac1 100644 --- a/docs/ref/models/expressions.txt +++ b/docs/ref/models/expressions.txt @@ -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 -- cgit v1.3