summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2005-01-27 21:50:23 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2005-01-27 21:50:23 +0000
commit64e3271ebc1e02d146b17da89026ff34ba344016 (patch)
tree80ed0d9dba445ef6f51d76c9deac021dcc31c550
parent05dadca2a0921be9586d0ef40ac97cf67f28c187 (diff)
Now that I look at it, int_array_enum() didn't work either.
-rw-r--r--contrib/intagg/int_aggregate.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/contrib/intagg/int_aggregate.c b/contrib/intagg/int_aggregate.c
index d968c201158..abb84801fb2 100644
--- a/contrib/intagg/int_aggregate.c
+++ b/contrib/intagg/int_aggregate.c
@@ -199,6 +199,10 @@ int_enum(PG_FUNCTION_ARGS)
if (!fcinfo->context)
{
/* Allocate a working context */
+ MemoryContext oldcontext;
+
+ oldcontext = MemoryContextSwitchTo(fcinfo->flinfo->fn_mcxt);
+
pc = (CTX *) palloc(sizeof(CTX));
/* Don't copy attribute if you don't need to */
@@ -216,6 +220,7 @@ int_enum(PG_FUNCTION_ARGS)
}
pc->num = 0;
fcinfo->context = (Node *) pc;
+ MemoryContextSwitchTo(oldcontext);
}
else /* use an existing one */
pc = (CTX *) fcinfo->context;