> You'll get a lot of cosmetic diffs (parallelized plans in EXPLAIN > and/or varying output row orders), but also half a dozen of the > aforesaid failure. >
I think I got the reason of those failures.
+ /* + * We can't use apply_projection_to_path() here, because there + * could already be pointers to these paths, and therefore we + * cannot modify them in place. Instead, we must use + * create_projection_path(). The good news is this won't + * actually insert a Result node into the final plan unless + * it's needed, but the bad news is that it will charge for + * the node whether it's needed or not. Therefore, if the + * target list is already what we need it to be, just leave + * this partial path alone. + */ + if (equal(scanjoin_target->exprs, subpath->pathtarget->exprs)) + continue;
This condition is incomplete with respect to PathTarget. What if target exprs are same, but sortgrouprefs doesn't tally? I will try with by modifying above condition to include sortgrouprefs as well.