-
+
User-Defined Functions
{
FuncCallContext *funcctx;
Datum result;
- MemoryContext oldcontext;
further declarations as needed
if (SRF_IS_FIRSTCALL())
{
+ MemoryContext oldcontext;
+
funcctx = SRF_FIRSTCALL_INIT();
oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx);
/* One-time setup code appears here: */
TupleDesc tupdesc;
AttInMetadata *attinmeta;
- /* stuff done only on the first call of the function */
- if (SRF_IS_FIRSTCALL())
- {
+ /* stuff done only on the first call of the function */
+ if (SRF_IS_FIRSTCALL())
+ {
MemoryContext oldcontext;
/* create a function context for cross-call persistence */