#30246: Using an annotated field calculated with 
in aggregate results in ProgrammingError
     Reporter:  Jan Baryła           |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  2.1
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:  query, aggregate,    |             Triage Stage:
  extract, annotate                  |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0

Comment (by Jan Baryła):

 I'm sorry for the confusion - this is my first ticket on your bugtracker.
 You're right about Django 1.8 - I obviously meant 1.10. And yes, it worked
 on that version. I've also tested it on the newest 2.2b1 and it doesn't

 I followed your advice and tried bisecting the change. I quickly found out
 that the bug is dependent on the database backend - it worked out of the
 box on the current master with SQLite. After changing the database backend
 to django.db.backends.postgresql, I managed to reproduce the bug, and then
 I started the bisection. The commit that introduced the breaking change is

 I have attached the test that I've used. It's very basic, but it pinpoints
 the issue. All you need to do is put it into tests/aggregation, and change
 the DATABASES in tests/test_sqlite.py to a Postgres DB.

 By the way, thank you for trying to guide me towards a different approach
 - I'd gladly use it, but what I've posted is just the beginning of a more
 complicated use case that will need this aggregation to work.

 I will try to find the cause of the issue and create a patch if no one
 else figures it out till then. Thanks for your quick response.

Ticket URL: <https://code.djangoproject.com/ticket/30246#comment:2>
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
For more options, visit https://groups.google.com/d/optout.

Reply via email to