I'm going to close this patch as returned with feedback, since it's had plenty and it's pretty clear that it will take some time to address it. Pavan is welcome to resubmit when he has a new version.
-- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services