Support for Postgresql partial indexes, index algorithms etc

Backported from AR4