Welcome
django-postgres-extra aims to make all of PostgreSQL’s awesome features available through the Django ORM. We do this by taking care of all the hassle. As opposed to the many small packages that are available to try to bring a single feature to Django with minimal effort, django-postgres-extra goes the extra mile with well tested implementations, seamless migrations and much more.
By seamless, we mean that any features we add will work truly seamlessly. You should not have to manually modify your migrations to work with fields and objects provided by this package.
Features
Explore the documentation to learn about all features:
-
Adds support for PostgreSQL’s
ON CONFLICTsyntax for inserts. Supports forDO UPDATEandDO NOTHING. Single statement, atomic, concurrency safe upserts. Supports conditional updates as well. -
Adds support for PostgreSQL 11.x declarative table partitioning. Integrated into Django migrations. Supports all types of partitioning. Includes a command to automatically create time-based partitions.
-
Adds support for creating views & materialized views as any other model. Integrated into Django migrations.
-
Support for explicit table-level locks.
-
Support for managing Postgres schemas.
-
Support for
TRUNCATE TABLEstatements (including cascading).
For Django 3.1 and older:
-
Partial (unique) index that only applies when a certain condition is true.
-
Case insensitive index, allows searching a column and ignoring the casing.
For Django 2.2 and older:
-
Unique indices that can span more than one field.
HStore key unique & required constraint
Add unique and required constraints in specific hstore keys.
Overview
- Installation
- Managers & Models
- HStore
- Indexes
- Conflict handling
- Deletion
- Table partitioning
- Views & materialized views
- Expressions
- Annotations
- Locking
- Schema
- Settings
- API Reference
PostgresManagerPostgresQuerySetPostgresMaterializedViewModelPostgresModelPostgresPartitionedModelPostgresViewModelHStoreFieldHStoreRefDateTimeEpochExcludedColUniqueIndexConditionalUniqueIndexCaseInsensitiveUniqueIndexPostgresTableLockModepostgres_lock_model()postgres_lock_table()PostgresSchemapostgres_temporary_schema()PostgresCurrentTimePartitioningStrategyPostgresModelPartitioningPlanPostgresPartitionPostgresPartitioningConfigPostgresPartitioningErrorPostgresPartitioningManagerPostgresPartitioningPlanPostgresPartitioningStrategyPostgresRangePartitionPostgresRangePartitioningStrategyPostgresTimePartitionPostgresTimePartitionSizePostgresTimePartitioningStrategypartition_by_current_time()ApplyStatePostgresAddDefaultPartitionPostgresAddHashPartitionPostgresAddListPartitionPostgresAddRangePartitionPostgresCreateMaterializedViewModelPostgresCreatePartitionedModelPostgresCreateViewModelPostgresDeleteDefaultPartitionPostgresDeleteHashPartitionPostgresDeleteListPartitionPostgresDeleteMaterializedViewModelPostgresDeletePartitionedModelPostgresDeleteRangePartitionPostgresDeleteViewModelConflictActionPostgresPartitioningMethodStrEnumpostgres_manager()
- Major releases