While checking for shippability, we build the target list which is passed to the foreign server as fdw_scan_tlist. The target list contains a. All the GROUP BY expressions b. Shippable entries from the target list of upper relation c. Var and Aggref nodes from non-shippable entries from the target list of upper relation
The code in the patch doesn't seem to add Var nodes explicitly. It assumes that the Var nodes will be part of GROUP BY clause. The code is correct, I think.
Yes. Code is correct. Var nodes are already part of GROUP BY else we hit error well before this point.
Thanks Ashutosh for the detailed review comments.
I am working on it and will post updated patch once I fix all your concerns.
Thanks
--
Jeevan B Chalke Principal Software Engineer, Product Development EnterpriseDB Corporation The Enterprise PostgreSQL Company