After further work on the comments, I pushed the result.
Thanks for working on this.
Thanks for pushing!
BTW, I noticed a typo in the comment of add_base_clause_to_rel.
--- a/src/backend/optimizer/plan/initsplan.c +++ b/src/backend/optimizer/plan/initsplan.c @@ -2644,7 +2644,7 @@ add_base_clause_to_rel(PlannerInfo *root, Index relid, * apply_child_basequals() sees, whereas the inh==false one is what's used * for the scan node in the final plan. * - * We make an exception to this is for partitioned tables. For these, we + * We make an exception to this for partitioned tables. For these, we