Hi django-developers,
The most common use case is partial unique constraints, but I have a few projects where non-unique partial indexes have turned out useful as well.
I have a few questions on how to continue with this:
1. Right now the "where condition" expression is provided as a string, and has to be different for PostgreSQL and SQLite in some common cases (for example boolean literals). Is there a good abstraction for SQL expressions somewhere in Django internals that I could use instead, something similar to Q-expressions perhaps? In particular, to add validate_unique() support to ModelForms, I would need to be able to extract all fields that are mentioned in the where condition.
3. If separate, then it would be nice to one day get partial indexes merged into the contrib.postgres package. Do you have any suggestions on what needs to happen before that - more test coverage, more contributors, more users, or similar?
Best,
Mattias