#30246: Using an annotated field calculated with 
django.db.models.functions.Extract
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
 work.

 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
 b78d100fa62cd4fbbc70f2bae77c192cb36c1ccd.

 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 
https://groups.google.com/d/msgid/django-updates/067.6ac547d6bd3f6ee7e0034e11a5e3eea5%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to