pgsql: Fix incorrect handling of subquery pullup

2025-03-13 Thread Richard Guo
Fix incorrect handling of subquery pullup When pulling up a subquery, if the subquery's target list items are used in grouping set columns, we need to wrap them in PlaceHolderVars. This ensures that expressions retain their separate identity so that they will match grouping set columns when approp

pgsql: Fix incorrect handling of subquery pullup in the presence of gro

2018-01-12 Thread Tom Lane
Fix incorrect handling of subquery pullup in the presence of grouping sets. If we flatten a subquery whose target list contains constants or expressions, when those output columns are used in GROUPING SET columns, the planner was capable of doing the wrong thing by merging a pulled-up expression i

pgsql: Fix incorrect handling of subquery pullup in the presence of gro

2018-01-12 Thread Tom Lane
Fix incorrect handling of subquery pullup in the presence of grouping sets. If we flatten a subquery whose target list contains constants or expressions, when those output columns are used in GROUPING SET columns, the planner was capable of doing the wrong thing by merging a pulled-up expression i

pgsql: Fix incorrect handling of subquery pullup in the presence of gro

2018-01-12 Thread Tom Lane
Fix incorrect handling of subquery pullup in the presence of grouping sets. If we flatten a subquery whose target list contains constants or expressions, when those output columns are used in GROUPING SET columns, the planner was capable of doing the wrong thing by merging a pulled-up expression i

pgsql: Fix incorrect handling of subquery pullup in the presence of gro

2018-01-12 Thread Tom Lane
Fix incorrect handling of subquery pullup in the presence of grouping sets. If we flatten a subquery whose target list contains constants or expressions, when those output columns are used in GROUPING SET columns, the planner was capable of doing the wrong thing by merging a pulled-up expression i