django-pg-bulk-update
Django extension, executing bulk update operations for PostgreSQL
Decision gist · record as of 2026-08-14
Yes, if you are using Django with PostgreSQL and need to perform bulk updates or upserts on many records efficiently. The low install friction and permissive license make it straightforward to adopt. However, note that maintenance is dormant (last release 775 days ago)—verify compatibility with your Django version before committing, and be aware of the documented race condition in bulk_update_or_create on PostgreSQL < 9.5.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires PostgreSQL 9.4+ as the backend database; psycopg2 or psycopg2-binary must be installed separately.
- Django 1.8+ required.
- Low install friction with a pure-Python wheel distribution.
License · maintenance · safety
permissive license (permissive) — Licensed under BSD 3-clause, a permissive license with no restrictions on commercial or private use. You may modify and distribute freely provided you include the license notice.
last release 2024-06-30 (775 days) · last repo commit 2024-06-30 · 39 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 183,078 downloads/mo, #10,074 on PyPI
Alternatives
Verify before relying
pip install django-pg-bulk-update
from django_pg_bulk_update import bulk_update
# Update multiple records in one query
bulk_update(MyModel, {1: {'field': 'value'}, 2: {'field': 'value2'}})- Whether the dormant maintenance status (775 days since last release) poses a risk for compatibility with recent Django versions.
- Whether the known race condition issue in bulk_update_or_create on PostgreSQL < 9.5 affects your use case.
- Performance characteristics compared to native Django bulk operations on modern PostgreSQL versions.
What it is and what it does
django-pg-bulk-update is a Django extension that optimizes bulk update and create operations on PostgreSQL by generating raw SQL queries that handle multiple records with different values in a single database round-trip. It provides four main functions: bulk_update (updates multiple records), bulk_update_or_create (upsert pattern), bulk_create (creates multiple records), and pdnf_clause (builds complex OR-AND conditions as Django Q objects).
The package is designed for scenarios where you need to update or insert many rows with different field values based on key conditions—operations that would otherwise require multiple queries or loops. It supports advanced PostgreSQL features like JSONB operations, INSERT ON CONFLICT, and custom set functions (increment, concatenate, array operations). The library requires PostgreSQL 9.4+ and integrates with Django's ORM through custom managers or direct function calls.
Use it for
- Batch-update user records with different status values based on user IDs in a single query.
- Perform upsert operations (insert or update) on large datasets using INSERT ON CONFLICT on PostgreSQL 9.5+.
- Increment numeric fields (e.g., counters) across multiple records without fetching and re-saving each one.
- Concatenate or merge array/JSONB fields across bulk records with custom set functions.
- Build complex multi-condition WHERE clauses (OR-AND combinations) using the pdnf_clause helper.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you are using Django with PostgreSQL and need to perform bulk updates or upserts on many records efficiently.
The low install friction and permissive license make it straightforward to adopt. However, note that maintenance is dormant (last release 775 days ago)—verify compatibility with your Django version before committing, and be aware of the documented race condition in bulk_update_or_create on PostgreSQL < 9.5.
Install
django-pg-bulk-update on PyPI
Before you install
Low install friction with a pure-Python wheel distribution. Maintenance is dormant—last release was 775 days ago—but the repository remains active and unarchived. Relies on django, pytz, and typing as runtime dependencies, all standard.
Requires PostgreSQL 9.4+ as the backend database; psycopg2 or psycopg2-binary must be installed separately. Django 1.8+ required.
License in practice
Licensed under BSD 3-clause, a permissive license with no restrictions on commercial or private use. You may modify and distribute freely provided you include the license notice.
Quickstart
pip install django-pg-bulk-update
from django_pg_bulk_update import bulk_update
# Update multiple records in one query
bulk_update(MyModel, {1: {'field': 'value'}, 2: {'field': 'value2'}})
Verify before relying
- Whether the dormant maintenance status (775 days since last release) poses a risk for compatibility with recent Django versions.
- Whether the known race condition issue in bulk_update_or_create on PostgreSQL < 9.5 affects your use case.
- Performance characteristics compared to native Django bulk operations on modern PostgreSQL versions.
Package facts
| License | permissive license permissive |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 3 packagesdjangopytztyping |
| Maintenance | Dormant 775 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 183,078 / month, #10,074 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
Evidence: django_pg_bulk_update-3.7.3-py2.py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “django postgresql bulk update”
- django-pg-bulk-updateExecutes bulk update and bulk create operations on PostgreSQL…
- django-pg-returningExtends Django's ORM to capture and return rows modified by…
- django-postgres-copyProvides Django ORM integration for PostgreSQL's COPY command to…
Give your agent the search over MCP, or paste the wish link into any chat.
More Database packages
psycopg2-binary is a PostgreSQL database adapter for Python that implements the DB API 2.0 specification, enabling Python applications to connect to and query PostgreSQL databases with thread-safe concurrent operations.
Python client library for connecting to and executing commands against Redis key-value stores, supporting both synchronous and asynchronous operations.
Install it if your application needs to interact with Redis; the only prerequisite is a running Redis server instance.
YDB Python SDK is the official client library for connecting to and querying YDB databases from Python applications.
Install it if you need to connect Python applications to YDB databases.
Connects Python applications to Snowflake data warehouses using the DB API 2.0 specification, enabling SQL queries, data transfers, and warehouse operations.
sqlparse tokenizes SQL text into a tree of statements, clauses, and expressions, and provides functions to split scripts, format queries, and inspect parsed tokens without validating dialect or syntax.
Install it if you need to manipulate, format, or analyze SQL text programmatically.
Provides base adapter protocols and shared functionality that database adapters use to integrate with dbt-core, handling connections, dialect translation, relation caching, and core interface management.
See also django-pg-returning · django-bulk-update · django-postgres-copy · pgcopy · postgrest · salesforce-bulk · django-postgres-extra · djangorestframework-bulk · django-query-builder · django-chunkator