He asked for a show of hands: some 90% of the attendees use postgresql. It is the most popular database for django projects. Most of the core team favours it. It has a wide feature set and it is a proper active (non-oracle-owned) open source project.
Wide feature set… but not all of the features are supported by django. You can use several add-ons, but they’re not that nicely integrated. So he proposed a kickstarter project for creating django.contrib.postgres. 14k (in UK pounds) was raised by the kickstarter campaign! Wow. He thanked everyone that contributed (a couple of big contributions by companies by name).
The core of the project is to add support for a couple of data types, like array, json and hstore.
How to get all this working? Django 1.7 supports custom lookups. Lookups
and transforms. Currently they’re only supported in
.filter(). Lookups are
more elaborate, transforms are just for things like lowercasing something.
Postgres has a couple of special indexes you can use. Django will support them. They’re good for certain quite specific cases (a hash index is quicker only for equal-to queries, though in the question round it turned out that the hash index is being deprecated in postgres). You normally won’t need them unless you have a special case.
Expression indexes are much handier. You could make an index that first
lowercases everything, for instance. Partial indexes: indexes only on certain
items. Like “index this column only when
sold==False”. Really useful when
you only need to index a small portion of your table. Adding such an index
will happen in the
Meta of the model.
What will also be made: database views. Table-like object that you can query like it’s a table. They’re good for aggregates that might otherwise take a huge amount of time.
What might we do in the future? Possible features that are outside of the current kickstarter project:
django.contrib.gisis full of (necessary) hacks. But the changes for this kickstarter make it possible to make the postgres gis backend hack-free.
In the whole, the work done for this kickstarter should make other database extension work easier. Look forward to nice new projects in this area!
My name is Reinout van Rees and I work a lot with Python (programming language) and Django (website framework). I live in The Netherlands and I'm happily married to Annie van Rees-Kooiman.
Most of my website content is in my weblog. You can keep up to date by subscribing to the automatic feeds (for instance with Google reader):