Do not pushdown aggregates with SRFs in the targetlist
authorPavan Deolasee <[email protected]>
Mon, 20 Aug 2018 10:43:20 +0000 (16:13 +0530)
committerPavan Deolasee <[email protected]>
Mon, 20 Aug 2018 10:43:20 +0000 (16:13 +0530)
src/backend/optimizer/plan/planner.c

index 321306bfedbe632c5afd2adc2d579ff3baba7474..199301c6ba0f4dcec1109c4006ee268e707a05c4 100644 (file)
@@ -3987,6 +3987,10 @@ create_grouping_paths(PlannerInfo *root,
                /* Insufficient support for partial mode. */
                try_distributed_aggregation = false;
        }
+       else if (parse->hasTargetSRFs)
+       {
+               try_distributed_aggregation = false;
+       }
        else
        {
                /* Everything looks good. */