New version of the patch with several fixes is attached.Many thanks to Roman Zharkov for testing.
-- Konstantin KnizhnikPostgres Professional: http://www.postgrespro.comThe Russian Postgres Company