Major releases
1.x
First release.
2.x
New features
Support for PostgreSQL 11.x declarative table partitioning.
Support for
TRUNCATE TABLECase insensitive index
Other changes
Uses Django 2.x’s mechanism for overriding queries and compilers.
django-postgres-extrais extensible in the same way that Django is extensible now.Removes hacks because Django 2.x is more extensible.
Breaking changes
Removes support for
psqlextra.signals. Switch to standard Django signals.Inserts with
ConflictAction.NOTHINGonly returns new rows. Conflicting rows are not returned.Drop support for Python 3.5.
Drop support for Django 1.x.
Removes
psqlextra.expressions.Min,psqlextra.expressions.Max, these are natively supported by Django.
FAQ
Why was
psqlextra.signalsremoved?In order to make
psqlextra.signals.updatework,django-postgres-extrahooked into Django’sdjango:django.db.models.query.QuerySet.update()method to add aRETURNING idclause to the statement. This slowed down all update queries, even if no signal handler was registered. To fix the performance impact, a breaking change was needed.The feature had little to do with PostgreSQL itself. This package focuses on making PostgreSQL specific features available in Django.
Signals being a rarely used feature that slows down unrelated queries was enough motivation to permanently remove it.
Why are inserts with
ConflictAction.NOTHINGnot returning conflicting rows anymore?This is standard PostgresQL behavior.
django-postgres-extrav1.x tried to working around this by doing a voidON CONFLICT UPDATE. This trick only worked when inserting one row.The work-around had a significant performance impact and was confusing when performing bulk inserts. In that case, only one row would be returned.
To avoid further confusion,
ConflictAction.NOTHINGnow follows standard PostgresQL behavior.Why was support dropped for Python 3.5?
Python 3.6 added support for dataclasses.
Why was support dropped for Django 1.x?
Mainstream support for the last Django 1.11 was dropped in December 2017. Supporting both Django 1.x and Django 2.x was a major pain point. Dropping support for 1.x simplifies
django-postgres-extraand speeds up the development of new features.