pgsql: Fix missed step in removal of useless RESULT RTEs in the planner

2020-12-05 Thread Tom Lane
Fix missed step in removal of useless RESULT RTEs in the planner. Commit 4be058fe9 forgot that the append_rel_list would already be populated at the time we remove useless result RTEs, and it might contain PlaceHolderVars that need to be adjusted like the ones in the main parse tree. This could l

pgsql: Fix missed step in removal of useless RESULT RTEs in the planner

2020-12-05 Thread Tom Lane
Fix missed step in removal of useless RESULT RTEs in the planner. Commit 4be058fe9 forgot that the append_rel_list would already be populated at the time we remove useless result RTEs, and it might contain PlaceHolderVars that need to be adjusted like the ones in the main parse tree. This could l

pgsql: Fix missed step in removal of useless RESULT RTEs in the planner

2020-12-05 Thread Tom Lane
Fix missed step in removal of useless RESULT RTEs in the planner. Commit 4be058fe9 forgot that the append_rel_list would already be populated at the time we remove useless result RTEs, and it might contain PlaceHolderVars that need to be adjusted like the ones in the main parse tree. This could l