I'm using Django's ORM to insert thousands of objects in a Postgre's DB. And it works fine, but sometimes one of those registers have a wrong format and the insert operation doesn't work.
I can't do this kind of insert ignoring errors so I'd like to see the SQL executed by the operation and the bulk_insert only returns a list of the objects.
When in debug-mode you could use the
django.db.backends
logger. https://docs.djangoproject.com/en/1.8/topics/logging/#django-db-backendsIn production I would use loggers for PostGres itself, because saving these queries from within a Django process will (probably) have major impact on your performance.