Native PostgreSQL bulk update, upsert, and copy operations for Django. Current version 3.3.0, supports Python >=3.10, Django 5.x/6.x, Postgres 12-18. Regular releases every few months.
pip install django-pgbulkVerified import paths — ran on the pinned version, not inferred.
Bulk upsert (INSERT ... ON CONFLICT DO UPDATE) for a Django model.
Replace `redundant_updates=True` with `ignore_unchanged=True`. If you relied on the old default, set `ignore_unchanged=True` explicitly.
Upgrade Python to 3.10+. Use Django 4.2 LTS if stuck on Python 3.9.
Always provide the `fields` argument to `bulk_update`, e.g. `pgbulk.bulk_update(MyModel, data, fields=['name', 'age'])`