Doctrine currently doesn't support conditional unique keys. One commonly happening situation is when we have a model with a column (eg. named "deleted") indicates whether the record was deleted and should no longer be treated as active. If we have an unique index on a "name" column, the index should contain only records with deleted = false. It also concerns an unique validation.
I have prepared a patch for Doctrine_Validator_Unique and Doctrine_Export_Pgsql (Postgresql natively supports conditional indexes).
Example of usage: