# Behaviour change in Django 5.2 queryset.values\_list() for duplicate column names

**URL:** <https://forum.djangoproject.com/t/behaviour-change-in-django-5-2-queryset-values-list-for-duplicate-column-names/40408>\
**Category:** Using the ORM\
**Created:** [April 14, 2025, 8:40am UTC](https://forum.djangoproject.com/t/behaviour-change-in-django-5-2-queryset-values-list-for-duplicate-column-names/40408 "2025-04-14T08:40:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ShaheedHaque](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/shaheedhaque/32/17659_2.png) [@ShaheedHaque](https://forum.djangoproject.com/u/ShaheedHaque)\
**Post date:** [April 14, 2025, 8:40am UTC](https://forum.djangoproject.com/t/behaviour-change-in-django-5-2-queryset-values-list-for-duplicate-column-names/40408/1 "2025-04-14T08:40:20Z")

</div>

Hi all,

There is a behaviour change in Django 5.2 but I’m posting here rather than filing a bug because I may have been previously relying on unsupported behaviour. I have query which does boils down to this:

> qs = models.Employee.objects.values\_list(‘username’, ‘username’, ‘company\_\_legal\_name’)

Notice the repeated “username”. On Django 5.1.6 and 5.1.7, each result from the queryset is a 3-tuple whereas on 5.2 this is a 2-tuple. I suspect this is related to the change mention in the release notes which reads:

> The `SELECT` clause generated when using `QuerySet.values()` and `QuerySet.values_list()` now matches the specified order of the referenced expressions. Previously, the order was based on a set of counterintuitive rules which made query combination through methods such as `QuerySet.union()`unpredictable.

So, should I fix my code to handle the duplicate case, or is this a bug?

Thanks, Shaheed

---

<div class="post-metadata">

**Author:** ![jacobtylerwalls](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/jacobtylerwalls/32/30603_2.png) [@jacobtylerwalls](https://forum.djangoproject.com/u/jacobtylerwalls)\
**Post date:** [April 14, 2025, 12:06pm UTC](https://forum.djangoproject.com/t/behaviour-change-in-django-5-2-queryset-values-list-for-duplicate-column-names/40408/2 "2025-04-14T12:06:06Z")

</div>

This is a regression that will be fixed in 5.2.1, see [notes](https://docs.djangoproject.com/en/5.2/releases/5.2.1/#bugfixes).

---

<div class="post-metadata">

**Author:** ![ShaheedHaque](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/shaheedhaque/32/17659_2.png) [@ShaheedHaque](https://forum.djangoproject.com/u/ShaheedHaque)\
**Post date:** [April 14, 2025, 12:18pm UTC](https://forum.djangoproject.com/t/behaviour-change-in-django-5-2-queryset-values-list-for-duplicate-column-names/40408/3 "2025-04-14T12:18:30Z")

</div>

Thanks for confirming!
