[Django] #30148: Add postgresql logging to copy_expert() copy_to() cursor functions while in DEBUG

28 views
Skip to first unread message

Django

unread,
Jan 31, 2019, 4:31:31 PM1/31/19
to django-...@googlegroups.com
#30148: Add postgresql logging to copy_expert() copy_to() cursor functions while in
DEBUG
-----------------------------------------+------------------------
Reporter: Javier Buzzi | Owner: nobody
Type: New feature | Status: new
Component: Uncategorized | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 1
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------+------------------------
I ran into an issue where I was running postgres commands `copy_expert()`
/ `copy_to()` and my queries weren't showing up on my `connection.queries`
while `DEBUG=True`. I figured no one has needed this before, but I need it
for my tests to pass.

PR: https://github.com/django/django/pull/10920

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

Django

unread,
Jan 31, 2019, 4:48:24 PM1/31/19
to django-...@googlegroups.com
#30148: Add postgresql logging to copy_expert() copy_to() cursor functions while in
DEBUG
-------------------------------+--------------------------------------

Reporter: Javier Buzzi | Owner: nobody
Type: New feature | Status: new
Component: Uncategorized | Version: master
Severity: Normal | Resolution:

Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------

Comment (by Javier Buzzi):

PS. Im not sure if the tests i wrote are in the correct place. I'd be
happy to move them if they don't belong there.

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

Django

unread,
Jan 31, 2019, 7:39:51 PM1/31/19
to django-...@googlegroups.com
#30148: Add postgresql logging to copy_expert() copy_to() cursor functions while in
DEBUG
-------------------------------------+-------------------------------------

Reporter: Javier Buzzi | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | 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 Tim Graham):

* component: Uncategorized => Database layer (models, ORM)
* stage: Unreviewed => Accepted


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

Django

unread,
Feb 5, 2019, 3:42:45 PM2/5/19
to django-...@googlegroups.com
#30148: Add postgresql logging to copy_expert() copy_to() cursor functions while in
DEBUG
-------------------------------------+-------------------------------------

Reporter: Javier Buzzi | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Javier Buzzi):

* stage: Accepted => Ready for checkin


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

Django

unread,
Feb 12, 2019, 3:23:15 PM2/12/19
to django-...@googlegroups.com
#30148: Add postgresql logging to copy_expert() copy_to() cursor functions while in
DEBUG
-------------------------------------+-------------------------------------

Reporter: Javier Buzzi | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* needs_better_patch: 0 => 1
* stage: Ready for checkin => Accepted


Comment:

I suggested some refactoring that could precede this fix so that more
boilerplate doesn't need to be duplicated.

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

Django

unread,
Apr 24, 2019, 3:49:47 PM4/24/19
to django-...@googlegroups.com
#30148: Add postgresql logging to copy_expert() copy_to() cursor functions while in
DEBUG
-------------------------------------+-------------------------------------

Reporter: Javier Buzzi | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Javier Buzzi):

This is ready to be code reviewed.

--
Ticket URL: <https://code.djangoproject.com/ticket/30148#comment:5>

Django

unread,
Apr 25, 2019, 12:48:54 AM4/25/19
to django-...@googlegroups.com
#30148: Add postgresql logging to copy_expert() copy_to() cursor functions while in
DEBUG
-------------------------------------+-------------------------------------
Reporter: Javier Buzzi | Owner: Javier
| Buzzi
Type: New feature | Status: assigned

Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | 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 felixxm):

* owner: nobody => Javier Buzzi
* needs_better_patch: 1 => 0
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/30148#comment:6>

Django

unread,
Apr 29, 2019, 8:44:57 AM4/29/19
to django-...@googlegroups.com
#30148: Add postgresql logging to copy_expert() copy_to() cursor functions while in
DEBUG
-------------------------------------+-------------------------------------
Reporter: Javier Buzzi | Owner: Javier
| Buzzi
Type: New feature | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"f7408b49a54d746db252ebc7176a67506d183a58" f7408b49]:
{{{
#!CommitTicketReference repository=""
revision="f7408b49a54d746db252ebc7176a67506d183a58"
Refs #30148 -- Moved logging queries in CursorDebugWrapper to debug_sql()
contextmanager.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/30148#comment:7>

Django

unread,
Apr 29, 2019, 8:44:58 AM4/29/19
to django-...@googlegroups.com
#30148: Add postgresql logging to copy_expert() copy_to() cursor functions while in
DEBUG
-------------------------------------+-------------------------------------
Reporter: Javier Buzzi | Owner: Javier
| Buzzi
Type: New feature | Status: closed

Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution: fixed
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 Mariusz Felisiak <felisiak.mariusz@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"673fe2e3ec63614259e86e7a370b9d1e91fcc1e1" 673fe2e]:
{{{
#!CommitTicketReference repository=""
revision="673fe2e3ec63614259e86e7a370b9d1e91fcc1e1"
Fixed #30148 -- Logged COPY ... TO statements in connection.queries on
PostgreSQL.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/30148#comment:8>

Reply all
Reply to author
Forward
0 new messages