I've attached a rebased patch.
The previous patch was conflicting with parallel Hash Join (180428404)
-- David Rowley http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services