Attached please find rebased version of the patch.Now "projection" attribute is used instead of surjective/injective.
-- Konstantin KnizhnikPostgres Professional: http://www.postgrespro.comThe Russian Postgres Company