A simple annotation broke when I migrated by app from Django 1.8.x to
1.9.2, and I can't figure out why for the life of me.

Calling Company.objects.all().annotate(ticketcount=Count('srservice'))

throws an error "ProgrammingError: column "company.owner_id" must appear in
the GROUP BY clause or be used in an aggregate function"

Rolling back to Django 1.8.5 fixes the problem.
The DB backend is Postgres.

Please ignore the horrible DB schema.  It's not mine.  It's an
introspection of a horrible Windows ticketing app.

Models and traceback here:
https://gist.github.com/darkpixel/e8f494038d5192225901

Am I missing something?

-A

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEE%2BrGrHkeqoH642%3DA%3D0w4DnC%3D2T8xzfignQOjh5BLLMto5f3g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
  • [no subject] Aaron C. de Bruyn
    • Re: Simon Charette

Reply via email to