#24096: GROUP BY on oracle fails with TextField and BinaryField
-------------------------------------+-------------------------------------
     Reporter:  jarshwah             |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by jarshwah):

 Yes, this is the general case of #20971, so it is almost a duplicate. IMO
 the linked ticket is a bit confusing. Not sure if we should close this as
 a duplicate and add this information to the other or not.

 In any case, Oracle does not support grouping by primary key. All fields
 listed in the select list must also be present in the group by list.

 There are a few options I can think of:

 1. Document the limitation (must use values()) on Oracle
 2. Remove LOB type columns from the select and group by list
 3. Convert (with lossy behaviour) the LOBs to reasonable types in both
 lists
 4. Remove deferred columns from GROUP BY when the PK is available
 5. A combo of 2 and 4 - automatically defer LOB type columns and remove
 them from GROUP BY

 Option 5 provides the most reasonable behaviour here I think, as it
 shouldn't change results, and won't be lossy with regards to data. It
 should also allow the same django code to run on all backends, at the
 expense of an extra query on Oracle to fetch LOB results on demand.

--
Ticket URL: <https://code.djangoproject.com/ticket/24096#comment:3>
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/066.147d08c8eb3504b444305d39c1f15e88%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to