Avoiding PostgreSQL Pitfalls: The Hidden Cost of Failing Inserts

Avoiding PostgreSQL Pitfalls: The Hidden Cost of Failing Inserts

June 20, 2025 | Articles
Using Django create with exception handling for unique constraint violations causes expensive rollbacks and bloat; use ON CONFLICT DO NOTHING via bulk_create(ignore_conflicts) or raw SQL.
URL: https://johnnymetz.com/posts/postgresql-failing-insert/
Filed in: Articles
Sponsor banner

Sponsor Number One

Subscribe to Django News

Weekly Django news, articles, projects, and more. Curated by Jeff Triplett & William Vincent.

No spam, ever. We'll never share your email address and you can opt out at any time.