Attaching v2 patch, rebased on the latest master 17958972.
With Regards,Bharath Rupireddy.EnterpriseDB: http://www.enterprisedb.com