Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

✅ Tests CircleCI
📝 License License
📦 PyPi PyPi
🍀 Code coverage Coverage Status
Django Versions 2.0, 2.1, 2.2, 3.0, 3.1, 3.2, 4.0, 4.1, 4.2, 5.0, 5.1, 5.2
Python Versions 3.6, 3.7, 3.8, 3.9, 3.10, 3.11, 3.12, 3.13
Psycopg Versions 2, 3
📖 Documentation Read The Docs
⚠️ Upgrade Upgrade from v1.x
🏁 Installation Installation Guide
🔥 Features Features & Documentation
💧 Future enhancements Potential features

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.

With 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.


⚠️ This README is for v2. See the v1 branch for v1.x.


Major features

See the full list

  • Conflict handling (atomic upsert)

    Adds support for PostgreSQL's ON CONFLICT syntax for inserts. Supports DO UPDATE and DO NOTHING. Single statement, atomic and concurrency safe upserts. Supports conditional updates as well.

  • Table partitioning

    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.

  • Views & materialized views

    Adds support for creating views & materialized views as any other model. Integrated into Django migrations.

  • Locking models & tables

    Support for explicit table-level locks.

  • Creating/dropping schemas

    Support for managing PostgreSQL schemas.

  • Truncating tables

    Support for TRUNCATE TABLE statements (including cascading).

For Django 3.1 and older:

  • Conditional unique index
  • Case insensitive index

For Django 2.2 and older:

  • Unique index
  • HStore unique and required constraints on specific HStore keys

Working with the code

Prerequisites

  • PostgreSQL 14 or newer.
  • Django 5.x or newer.
  • Python 3.11 or newer.

These are just for local development. CI for code analysis etc runs against these. Tests will pass on all Python, Django and PostgreSQL versions documented. Linting, formatting and type-checking the code might not work on other Python and/or Django versions.

Getting started

  1. Clone the repository:

     λ git clone https://github.com/SectorLabs/django-postgres-extra.git
    
  2. Create a virtual environment:

    λ cd django-postgres-extra
    λ virtualenv env
    λ source env/bin/activate
    
  3. Create a postgres user for use in tests (skip if your default user is a postgres superuser):

    λ createuser --superuser psqlextra --pwprompt
    λ export DATABASE_URL=postgres://psqlextra:<password>@localhost/psqlextra
    

    Hint: if you're using virtualenvwrapper, you might find it beneficial to put the export line in $VIRTUAL_ENV/bin/postactivate so that it's always available when using this virtualenv.

  4. Install the development/test dependencies:

    λ pip install -r requirements-test.txt
    
  5. Run the tests:

    λ poe test
    
  6. Run the benchmarks:

    λ poe benchmark
    
  7. Auto-format code, sort imports and auto-fix linting errors:

    λ poe fix
    

Metadata

Release files for django-postgres-extra 3.0.0rc1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-postgres-extra 3.0.0rc1
File Size Uploaded
django_postgres_extra-3.0.0rc1.tar.gz 105.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-postgres-extra 3.0.0rc1
File Interpreter ABI Platform
django_postgres_extra-3.0.0rc1-py3-none-any.whl Python 3 none any Details

Total release size: 206.5 kB

Release files / django_postgres_extra-3.0.0rc1.tar.gz

Download URL django_postgres_extra-3.0.0rc1.tar.gz
Size 105.2 kB
Tags Source
SHA-256 checksum
How to use checksums
49c896db335edbc543653013b9e6694f3f7eb7d50f6c7f4cb53acfc0283960d8
BLAKE2b-256 checksum
How to use checksums
c8152388dd92f68359f298e4a02dfdb1042afce75609878a951a8644ddef154c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.2

Release files / django_postgres_extra-3.0.0rc1-py3-none-any.whl

Download URL django_postgres_extra-3.0.0rc1-py3-none-any.whl
Size 101.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
35228d3883cd0326fb50082273f2d59f9230566d96fb6ed170cf5888749b78c9
BLAKE2b-256 checksum
How to use checksums
345543f017db5a040126945fcf66147077ea48997e7b74cc5c8461d9dd3d9d95
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.2

Release history Release notifications | RSS feed

3.0.1

2 release files

3.0.0

2 release files

This release

3.0.0rc1 This release

2 release files

2.0.9

2 release files

2.0.8

2 release files

2.0.6

2 release files

2.0.5

2 release files

2.0.4

2 release files

2.0.3

2 release files

2.0.2

1 release file

2.0.1

1 release file

2.0

1 release file

1.22

1 release file

1.20

1 release file

1.19

1 release file

1.17

1 release file

1.14

1 release file

1.13

1 release file

1.12

1 release file

1.11

1 release file

1.10

1 release file

1.9

1 release file

1.8

1 release file

1.7

1 release file

1.6

1 release file

1.5

1 release file

1.4

1 release file

1.3

1 release file

1.2

1 release file

1.1

1 release file

1.0

1 release file

0.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page