Major releases¶
1.x¶
First release.
2.x¶
New features¶
Support for PostgreSQL 11.x declarative table partitioning.
Support for
TRUNCATE TABLE
Case insensitive index
Other changes¶
Uses Django 2.x’s mechanism for overriding queries and compilers.
django-postgres-extra
is 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.NOTHING
only 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.signals
removed?In order to make
psqlextra.signals.update
work,django-postgres-extra
hooked into Django’sdjango.db.models.query.QuerySet.update()
method to add aRETURNING id
clause 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.NOTHING
not returning conflicting rows anymore?This is standard PostgresQL behavior.
django-postgres-extra
v1.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.NOTHING
now 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-extra
and speeds up the development of new features.