Opened 5 years ago

Closed 5 years ago

#30148 closed New feature (fixed)

Add postgresql logging to copy_expert() copy_to() cursor functions while in DEBUG

Reported by: Javier Buzzi Owned by: Javier Buzzi
Component: Database layer (models, ORM) Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

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

Change History (8)

comment:1 by Javier Buzzi, 5 years ago

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.

comment:2 by Tim Graham, 5 years ago

Component: UncategorizedDatabase layer (models, ORM)
Triage Stage: UnreviewedAccepted

comment:3 by Javier Buzzi, 5 years ago

Triage Stage: AcceptedReady for checkin

comment:4 by Tim Graham, 5 years ago

Patch needs improvement: set
Triage Stage: Ready for checkinAccepted

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

comment:5 by Javier Buzzi, 5 years ago

This is ready to be code reviewed.

comment:6 by Mariusz Felisiak, 5 years ago

Owner: changed from nobody to Javier Buzzi
Patch needs improvement: unset
Status: newassigned

comment:7 by Mariusz Felisiak <felisiak.mariusz@…>, 5 years ago

In f7408b49:

Refs #30148 -- Moved logging queries in CursorDebugWrapper to debug_sql() contextmanager.

comment:8 by Mariusz Felisiak <felisiak.mariusz@…>, 5 years ago

Resolution: fixed
Status: assignedclosed

In 673fe2e:

Fixed #30148 -- Logged COPY ... TO statements in connection.queries on PostgreSQL.

Note: See TracTickets for help on using tickets.
Back to Top