diff options
Diffstat (limited to 'src/backend/executor/nodeAgg.c')
-rw-r--r-- | src/backend/executor/nodeAgg.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/backend/executor/nodeAgg.c b/src/backend/executor/nodeAgg.c index 0ae5873868b..1a1aebe7b08 100644 --- a/src/backend/executor/nodeAgg.c +++ b/src/backend/executor/nodeAgg.c @@ -3808,6 +3808,16 @@ find_compatible_pertrans(AggState *aggstate, Aggref *newagg, { ListCell *lc; + /* + * For the moment, never try to share transition states between different + * ordered-set aggregates. This is necessary because the finalfns of the + * built-in OSAs (see orderedsetaggs.c) are destructive of their + * transition states. We should fix them so we can allow this, but not + * losing performance in the normal non-shared case will take some work. + */ + if (AGGKIND_IS_ORDERED_SET(newagg->aggkind)) + return -1; + foreach(lc, transnos) { int transno = lfirst_int(lc); |