Don't cache per-group context across the whole query in orderedsetaggs.c.

Tom Lane <tgl@sss.pgh.pa.us>

Commit: ecd657974478fc713fdc3a625d648cd6a985e3e6
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2014-07-03T22:47:09Z
Releases: 9.5.0
Don't cache per-group context across the whole query in orderedsetaggs.c.

Although nodeAgg.c currently uses the same per-group memory context for
all groups of a query, that might change in future.  Avoid assuming it.
This costs us an extra AggCheckCallContext() call per group, but that's
pretty cheap and is probably good from a safety standpoint anyway.

Back-patch to 9.4 in case any third-party code copies this logic.

Andrew Gierth

Files

PathChange+/−
src/backend/utils/adt/orderedsetaggs.c modified +15 −13