Patch rebased to the current master is in attachments.
-- Anastasia LubennikovaPostgres Professional: http://www.postgrespro.comThe Russian Postgres Company