#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. -- 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 view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/058.980cefb12c34d514ce0afb3a37d2bfdf%40djangoproject.com.