summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2014-07-03 18:25:37 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2014-07-03 18:25:37 -0400
commitf688cf548b3e37991009b7a3607171242c796e62 (patch)
tree9ad67e8d3c9e05f918a029ee632534fdc9a95bd2 /src/include
parent6b56bc16cdf0c59e7d18ec046b2ed63bc82faf7b (diff)
Redesign API presented by nodeAgg.c for ordered-set and similar aggregates.
The previous design exposed the input and output ExprContexts of the Agg plan node, but work on grouping sets has suggested that we'll regret doing that. Instead provide more narrowly-defined APIs that can be implemented in multiple ways, namely a way to get a short-term memory context and a way to register an aggregate shutdown callback. Back-patch to 9.4 where the bad APIs were introduced, since we don't want third-party code using these APIs and then having to change in 9.5. Andrew Gierth
Diffstat (limited to 'src/include')
-rw-r--r--src/include/fmgr.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/include/fmgr.h b/src/include/fmgr.h
index 267403c410f..a901770948a 100644
--- a/src/include/fmgr.h
+++ b/src/include/fmgr.h
@@ -23,7 +23,7 @@ typedef struct Node *fmNodePtr;
typedef struct Aggref *fmAggrefPtr;
/* Likewise, avoid including execnodes.h here */
-typedef struct ExprContext *fmExprContextPtr;
+typedef void (*fmExprContextCallbackFunction) (Datum arg);
/* Likewise, avoid including stringinfo.h here */
typedef struct StringInfoData *fmStringInfo;
@@ -656,8 +656,10 @@ extern void **find_rendezvous_variable(const char *varName);
extern int AggCheckCallContext(FunctionCallInfo fcinfo,
MemoryContext *aggcontext);
extern fmAggrefPtr AggGetAggref(FunctionCallInfo fcinfo);
-extern fmExprContextPtr AggGetPerTupleEContext(FunctionCallInfo fcinfo);
-extern fmExprContextPtr AggGetPerAggEContext(FunctionCallInfo fcinfo);
+extern MemoryContext AggGetTempMemoryContext(FunctionCallInfo fcinfo);
+extern void AggRegisterCallback(FunctionCallInfo fcinfo,
+ fmExprContextCallbackFunction func,
+ Datum arg);
/*
* We allow plugin modules to hook function entry/exit. This is intended