#28062: Using QuerySet.iterator() with pgBouncer leads to nonexistent cursor
errors
-------------------------------------+-------------------------------------
Reporter: Sergey Fursov | Owner: François
| Freitag
Type: Bug | Status: assigned
Component: Database layer | Version: 1.11
(models, ORM) |
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by François Freitag):
* has_patch: 0 => 1
Comment:
[https://github.com/django/django/pull/8430 PR]
Working on this issue, I came to the conclusions that {{{None}}} is not
necessary and I prefer the simpler scheme where:
* the use of server-side cursors is disabled for a connection if the
setting is {{{False}}}.
* when the setting is {{{True}}}, server-side cursors are used by default
and users and library code can opt-out specifying
{{{chunked_fetch=False}}}.
I believe auto opt-in server-side cursors is acceptable, since it's a
memory improvement in most case. The issue here is that server-side
cursors cannot be used with transaction pooling, which is global to a
connection. Setting {{{ENABLE_SERVER_SIDE_CURSORS}}} to {{{False}}} for
the whole connection makes sense and should disable the use of server-side
cursors regardless of the {{{chunked_fetch}}} keyword argument.
For use cases where server-side cursors are not desirable, the user /
library-code can now turn them off explicitly using
{{{chunked_fetch=False}}}.
I think this solution is simpler and covers the use cases I can think of.
Am I missing something?
--
Ticket URL: <https://code.djangoproject.com/ticket/28062#comment:9>
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 post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/064.3941028ae322fcdb5ea6bbd1ad4d65d0%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.