#31251: QuerySet.annotate() crashes when grouping by OuterRef().
-------------------------------------+-------------------------------------
     Reporter:  Oliver Ford          |                    Owner:  (none)
         Type:                       |                   Status:  new
  Cleanup/optimization               |
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:  db,outerref,group    |             Triage Stage:  Accepted
  by,subquery,annotate               |
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  1                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Yuri Savin):

 Replying to [comment:5 felixxm]:
 > Oliver, `OuterRef()` is a field from the outer query, so it will be the
 same for all rows in a subquery. Is there any value in adding it to a
 `GROUP BY` clause? e.g.
 > {{{
 > (SELECT MIN("price") from "subquery_table" GROUP BY
 "outer_table"."type")
 > }}}
 > is equivalent to
 > {{{
 > (SELECT MIN("price") from "subquery_table")
 > }}}

 I think you can close this ticket better than i'm

-- 
Ticket URL: <https://code.djangoproject.com/ticket/31251#comment:7>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.26be5760b8611054c37b4764188e78e1%40djangoproject.com.

Reply via email to