In match_eclasses_to_foreign_key_col(), there is this:
if (em->em_is_child)
continue; /* ignore children here */
ISTM, it might as well be:
Assert(!em->em_is_child); /* no children yet */
That's because, I think it's still too early in query_planner() to be
expecting any child EC members.
Thanks,
Amit