Patch fails on current master, but correctly applies to 9e43e87. Thanks for including the commit id.
Regression tests pass.
As with my last attempt at reviewing this patch, I'm confused about what kind of queries can take advantage of this patch. Is it only cases where a local table has multiple inherited foreign table children? Will it work with queries where two foreign tables are referenced and combined with a UNION ALL?