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