> Fair point. I think we can back-patch a more minimal fix, as Tom > proposed in [1], which disallows the reparameterization if the path > contains sampling info that references the outer rel. But I think we > need also to disallow the reparameterization of a path if it contains > restriction clauses that reference the outer rel, as such paths have > been found to cause incorrect results, or planning errors as in [2].
Do you want to produce a patch for that, to go along with this patch for master?
Sure, here it is: v10-0001-Avoid-reparameterizing-Paths-when-it-s-not-suitable.patch
I forgot to mention that this patch applies on v16 not master.