[Django] #19948: Improve connection reset under PostgreSQL

10 views
Skip to first unread message

Django

unread,
Feb 28, 2013, 4:27:25 PM2/28/13
to django-...@googlegroups.com
#19948: Improve connection reset under PostgreSQL
-------------------------------------+-------------------------------------
Reporter: aaugustin | Owner: nobody
Type: | Status: new
Cleanup/optimization | Version: master
Component: Database | Keywords:
layer (models, ORM) | Has patch: 0
Severity: Normal | Needs tests: 0
Triage Stage: Accepted | Easy pickings: 0
Needs documentation: 0 |
Patch needs improvement: 0 |
UI/UX: 0 |
-------------------------------------+-------------------------------------
On django-developers, Christopher 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.

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

Django

unread,
Feb 28, 2013, 4:28:03 PM2/28/13
to django-...@googlegroups.com
#19948: Improve connection reset under PostgreSQL
-------------------------------------+-------------------------------------
Reporter: aaugustin | Owner: nobody
Type: | Status: new
Cleanup/optimization | Version: master
Component: Database layer | Resolution:
(models, ORM) | Triage Stage: Accepted
Severity: Normal | Needs documentation: 0
Keywords: | Patch needs improvement: 0
Has patch: 0 | UI/UX: 0
Needs tests: 0 |
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Description changed by aaugustin:

Old description:

> On django-developers, Christopher 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.

New description:

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.

--

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

Django

unread,
Feb 28, 2013, 4:32:16 PM2/28/13
to django-...@googlegroups.com
#19948: Improve connection reset under PostgreSQL
-------------------------------------+-------------------------------------
Reporter: aaugustin | Owner: nobody
Type: | Status: new
Cleanup/optimization | Version: master
Component: Database layer | Resolution:
(models, ORM) | Triage Stage: Accepted
Severity: Normal | Needs documentation: 0
Keywords: | Patch needs improvement: 0
Has patch: 0 | UI/UX: 0
Needs tests: 0 |
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by carljm):

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.

--
Ticket URL: <https://code.djangoproject.com/ticket/19948#comment:2>

Django

unread,
Feb 28, 2013, 4:40:03 PM2/28/13
to django-...@googlegroups.com
#19948: Improve connection reset under PostgreSQL
-------------------------------------+-------------------------------------
Reporter: aaugustin | Owner: nobody
Type: | Status: new
Cleanup/optimization | Version: master
Component: Database layer | Resolution:
(models, ORM) | Triage Stage: Accepted
Severity: Normal | Needs documentation: 0
Keywords: | Patch needs improvement: 0
Has patch: 0 | UI/UX: 0
Needs tests: 0 |
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by aaugustin):

Yes, it should.

--
Ticket URL: <https://code.djangoproject.com/ticket/19948#comment:3>

Django

unread,
Oct 1, 2015, 8:00:24 AM10/1/15
to django-...@googlegroups.com
#19948: Improve connection reset under PostgreSQL
-------------------------------------+-------------------------------------
Reporter: aaugustin | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by auvipy):

any update on this?

--
Ticket URL: <https://code.djangoproject.com/ticket/19948#comment:4>

Django

unread,
May 19, 2026, 4:07:46 PM (2 days ago) May 19
to django-...@googlegroups.com
#19948: Improve connection reset under PostgreSQL
-------------------------------------+-------------------------------------
Reporter: Aymeric Augustin | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Aryan Gholizadeh Mojaveri):

Hi all, sorry if im being stupid but is this ticket suggesting a new
backend method that ''does not'' replace the default close behavior? In
that case when would this be used? Given that this ticket is very old, can
i start working on a PR with the assumption that it ''does'' imply
replacement?
--
Ticket URL: <https://code.djangoproject.com/ticket/19948#comment:5>
Reply all
Reply to author
Forward
0 new messages