#35830: Queryset Union doesn't persist column names
-------------------------------------+-------------------------------------
     Reporter:  Paul Landon Tuckett  |                     Type:  Bug
       Status:  new                  |                Component:  Database
                                     |  layer (models, ORM)
      Version:  4.2                  |                 Severity:  Normal
     Keywords:  orm, database,       |             Triage Stage:
  queryset, union, sql               |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
 In Django v3.2.25 doing a queryset.union() would preserve the original
 column names. Upgrading to Django 4.2.16, this is no longer the case. It
 converts all the columns (minus annotations), to col1, col2, etc. The
 column names are the same in each queryset and the data types are the
 same. Even if you do a union() on the exact same queryset, the columns are
 renamed, ie: queryset.union(queryset). If this is expected behavior,
 please disregard. I'm not seeing anything in the change log that
 references this change.
-- 
Ticket URL: <https://code.djangoproject.com/ticket/35830>
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107019278916265-12f13795-346b-496c-b779-13307b0e1862-000000%40eu-central-1.amazonses.com.

Reply via email to