[Django] #30959: (PostgreSQL-backed) QuerySet.iterator() returns no result although QuerySet.count() is a positive number

6 views
Skip to first unread message

Django

unread,
Nov 6, 2019, 1:05:25 PM11/6/19
to django-...@googlegroups.com
#30959: (PostgreSQL-backed) QuerySet.iterator() returns no result although
QuerySet.count() is a positive number
-------------------------------------+-------------------------------------
Reporter: | Owner: nobody
TheVinhLuong102 |
Type: | Status: new
Uncategorized |
Component: | Version: 2.2
Uncategorized |
Severity: Release | Keywords: PostgreSQL,
blocker | iterator
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
I'm using Django 2.2.6 on Python 3.7. My database is PostgreSQL engine
version 11.5, hosted on Amazon RDS.

I'm encountering a situation in which a QuerySet qs I construct has a
positive number of records, as confirmed by qs.count() being over 1
million. However, when I try to iterate through those records using
qs.iterator(), there're no iterations being performed.

I try reconstructing the queryset and test: test_iterator =
qs.interator(); next(test_iterator) -- and I confirm that this returns the
StopIteration error, which means the iterator is indeed empty.

--
Ticket URL: <https://code.djangoproject.com/ticket/30959>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Nov 7, 2019, 2:47:42 AM11/7/19
to django-...@googlegroups.com
#30959: QuerySet.iterator() returns no result although QuerySet.count() is a
positive number.
-------------------------------------+-------------------------------------
Reporter: Vinh Luong | Owner: nobody
Type: Bug | Status: closed
Component: Database layer | Version: 2.2
(models, ORM) | Resolution:
Severity: Normal | worksforme
Keywords: PostgreSQL, | Triage Stage:
iterator | Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):

* status: new => closed
* severity: Release blocker => Normal
* type: Uncategorized => Bug
* component: Uncategorized => Database layer (models, ORM)
* resolution: => worksforme


Comment:

`iterator()` works fine for me on PostgreSQL. I don't think that's an
issue in Django.

--
Ticket URL: <https://code.djangoproject.com/ticket/30959#comment:1>

Reply all
Reply to author
Forward
0 new messages