Opened 12 years ago
Last modified 9 years ago
#19948 new Cleanup/optimization
Improve connection reset under PostgreSQL
Description (last modified by ) ¶
On django-developers, Christophe Pettus says:
It would be helpful to have a backend method that performers the "restore connection between uses" function, rather than just use connection.abort() (of course, the default implementation can use that). For example, on PostgreSQL, ABORT; DISCARD ALL is the recommended way of resetting a connection, so being able to implement that would be great.
This was independently suggested by Anssi, and it looks like a good idea to implement.
According to the ticket's flags, the next step(s) to move this issue forward are:
- To provide a patch by sending a pull request. Claim the ticket when you start working so that someone else doesn't duplicate effort. Before sending a pull request, review your work against the patch review checklist. Check the "Has patch" flag on the ticket after sending a pull request and include a link to the pull request in the ticket comment when making that update. The usual format is:
[https://github.com/django/django/pull/#### PR]
.
I think "ABORT; DISCARD ALL" may also need to be followed up with
self.init_connection_state()
, because it would otherwise discard the session state that Django sets up for each connection.