django-pgmigrate
Avoid costly downtime during Postgres migrations.
Decision gist · record as of 2026-08-14
Yes, if you run Django on Postgres and want to reduce migration downtime. The package is straightforward to install, has no security vulnerabilities, and solves a real operational problem. The aging maintenance status is a minor concern but not a blocker—the codebase is stable and compatible with current versions. Install it if migration locking is a pain point; skip it if you use other databases or have short, non-blocking migrations.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Django 4.2–6.0, Python 3.10–3.14, Postgres 14–18, and Psycopg 2–3.
- Low friction install with a pure Python wheel.
- Maintenance status is aging—last commit was 2025-11-30 and the project has 28 stars—but the package remains actively maintained and compatible with current Django and Python versions.
License · maintenance · safety
BSD-3-Clause (permissive) — BSD-3-Clause is permissive and poses no restriction on commercial or private use.
last release 2025-11-30 (257 days) · last repo commit 2025-11-30 · 28 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 989,583 downloads/mo, #4,566 on PyPI
Alternatives
Verify before relying
pip install django-pgmigrate
# Add to Django INSTALLED_APPS:
# 'pgactivity', 'pglock', 'pgmigrate'
python manage.py migrate- Whether automatic query termination is safe for all workload types or if manual inspection is recommended in production.
- Performance impact of blocking-query detection during large migration batches.
What it is and what it does
django-pgmigrate is a Django management command wrapper that solves a common Postgres migration problem: when long-running transactions hold locks, subsequent migrations queue behind them and block all queries on the affected model. The package detects these blocking queries and either terminates them automatically (the default) or prints them for manual review. It also supports setting lock timeouts to cancel migrations that block too long.
The package integrates into Django's standard migrate command and requires adding three apps to INSTALLED_APPS. It works with Django 4.2–6.0, Python 3.10–3.14, and Postgres 14–18, making it compatible with modern Django deployments. The two runtime dependencies are django and django-pglock.
Use it for
- Automatically terminate blocking queries during production migrations to prevent cascading locks.
- Inspect and manually manage blocking activity instead of auto-terminating for workloads requiring careful query control.
- Set lock timeouts to fail fast if a migration blocks longer than a configured threshold.
- Monitor Postgres process IDs during migrations to correlate blocking activity with application logs.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you run Django on Postgres and want to reduce migration downtime.
The package is straightforward to install, has no security vulnerabilities, and solves a real operational problem. The aging maintenance status is a minor concern but not a blocker—the codebase is stable and compatible with current versions. Install it if migration locking is a pain point; skip it if you use other databases or have short, non-blocking migrations.
Install
django-pgmigrate on PyPI
Before you install
Low friction install with a pure Python wheel. Maintenance status is aging—last commit was 2025-11-30 and the project has 28 stars—but the package remains actively maintained and compatible with current Django and Python versions.
Requires Django 4.2–6.0, Python 3.10–3.14, Postgres 14–18, and Psycopg 2–3.
License in practice
BSD-3-Clause is permissive and poses no restriction on commercial or private use.
Quickstart
pip install django-pgmigrate
# Add to Django INSTALLED_APPS:
# 'pgactivity', 'pglock', 'pgmigrate'
python manage.py migrate
Verify before relying
- Whether automatic query termination is safe for all workload types or if manual inspection is recommended in production.
- Performance impact of blocking-query detection during large migration batches.
Package facts
| License | BSD-3-Clause permissive |
| Python support | Supports the current Python release <4,>=3.10.0 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packagesdjangodjango-pglock |
| Maintenance | Aging 257 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 989,583 / month, #4,566 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Framework :: DjangoFramework :: Django :: 4.2Framework :: Django :: 5.0Framework :: Django :: 5.1Framework :: Django :: 5.2Framework :: Django :: 6.0Intended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14 |
Evidence: django_pgmigrate-1.6.0-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 › “postgres migration locking”
- django-pgmigratePrevents migration downtime by detecting and terminating blocking…
- django-pglocksProvides PostgreSQL advisory locks for Django applications through…
- django-pg-zero-downtime-migrationsProvides a Django database backend for PostgreSQL that executes…
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-zero-downtime-migrations · django-pglock · django-safemigrate · django-pg-migration-tools · django-linear-migrations · django-read-only · django-pgactivity · squawk-cli · django-migration-linter · django-sequences