Thanks for your advice, Justin and Alvaro!
I'll try to reduce the size of this patch and split it into separate parts (for MERGE and SPLIT).
-- With best regards,Dmitry Koval
Postgres Professional: http://postgrespro.com