I wrote: > Yeah, I think we can likely get away with that. We cannot back-patch > the changes that added relid to the outfuncs/readfuncs representation, > which means that the RTE's relid won't propagate to parallel workers, > but I don't see why they'd need it. We only need that info to get > as far as planning. I've not tried though.
OK, the attached patch for v15 passes check-world, with or without force_parallel_mode. I'm inclined to commit the rewriteHandler.c and parsenodes.h bits in a separate patch for commit log visibility.
The attached patch looks better than my proposed code.