Sorry, attached version of the patch is missing changes in one file. Here is it correct patch.
-- Konstantin KnizhnikPostgres Professional: http://www.postgrespro.comThe Russian Postgres Company