Skip to main content
DjanQuiltDB

djanquiltdb-plugin-postgres-denormalize

PyPI Supported Python versions Supported Django versions Supported PostgreSQL versions CI Documentation Coverage BSD-3-Clause licence

django-postgres-denormalize stores copies of related columns in ordinary columns, and keeps them up to date with Postgres triggers. DjanQuiltDB shards a database across schemas and nodes. This library finds and corrects the copies that are out of date, in one shard or in every shard:

from djanquiltdb.utils.postgres_denormalize import repair_every_shard, stale_rows

stale_rows(shard)  # {<class 'Task'>: 3}
repair_every_shard()

Install it through DjanQuiltDB’s extra:

pip install djanquiltdb[postgres-denormalize]

The installation guide describes each step in full. postgres_denormalize and the pgtrigger app that it builds on go in INSTALLED_APPS. Run every node that stores copies at SERIALIZABLE, because at a lower level a copy can differ from its lookup path, and retry the transactions that fail with a serialization error:

# settings.py
from django.db.backends.postgresql.psycopg_any import IsolationLevel

INSTALLED_APPS = [
    ...
    'djanquiltdb',
    'pgtrigger',
    'postgres_denormalize',
    ...
]

DATABASES = {
    'default': {
        ...,
        'OPTIONS': {'isolation_level': IsolationLevel.SERIALIZABLE},
    },
}

Do not copy a column of a mirrored or public model. The triggers of such a copy only reach the current shard, and fail outside one.

Full documentation is at https://djanquiltdb.readthedocs.io/en/latest/plugins/postgres-denormalize/index.html.

Development

This package is developed in the DjanQuiltDB repository beside djanquiltdb itself. Tests run through tox against the Postgres containers in the repository’s docker-compose.yml; see DOCKER.md at the repository root:

docker compose run --rm test tox

Requirements

  • Python 3.12 to 3.15

  • Django 6.0 or 6.1

  • PostgreSQL 17 or 18

  • djanquiltdb 4.3.0 or newer 4.x

  • django-postgres-denormalize 1.1.0 or newer 1.x

Unlike DjanQuiltDB and its other plugins, this plugin does not support Django 5.2. django-postgres-denormalize relies on Django returning the columns that a trigger computes from an UPDATE’s RETURNING clause, so that a saved instance has their new values, and Django 6.0 is the first release that does.

Metadata

Release files for djanquiltdb-plugin-postgres-denormalize 1.1.0

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

Source distribution (sdist)

Source distribution for djanquiltdb-plugin-postgres-denormalize 1.1.0
File Size Uploaded Provenance Actions
djanquiltdb_plugin_postgres_denormalize-1.1.0.tar.gz 18.1 kB With provenance Details for djanquiltdb_plugin_postgres_denormalize-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for djanquiltdb-plugin-postgres-denormalize 1.1.0
File Interpreter ABI Platform Actions
djanquiltdb_plugin_postgres_denormalize-1.1.0-py3-none-any.whl Python 3 none any Details for djanquiltdb_plugin_postgres_denormalize-1.1.0-py3-none-any.whl

Total release size: 25.1 kB

Release files / djanquiltdb_plugin_postgres_denormalize-1.1.0.tar.gz

Download URL djanquiltdb_plugin_postgres_denormalize-1.1.0.tar.gz
Size 18.1 kB
Tags Source
SHA-256 checksum
How to use checksums
78cbdbb68e65f4771c5f86178a45ccd1e9dc78a29516e9aa359afbb4fe72b049
BLAKE2b-256 checksum
How to use checksums
5c0ae2fc53782ffdea19be9756662e3eb985b7c0b685065ba208a1883faa658b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.

Transparency log

Release files / djanquiltdb_plugin_postgres_denormalize-1.1.0-py3-none-any.whl

Download URL djanquiltdb_plugin_postgres_denormalize-1.1.0-py3-none-any.whl
Size 7.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d1edd9b9e78d2cab8dfece25efa5ff177b4241f3eb34134e7bfe2bf35268c3ae
BLAKE2b-256 checksum
How to use checksums
2d3712a2c4000d7652bf2c25f89954b766e2bf500f438ba20580a34545da427f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.

Transparency log

Security for djanquiltdb-plugin-postgres-denormalize 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for djanquiltdb_plugin_postgres_denormalize-1.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files Full provenance

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