summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2005-01-27 21:50:06 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2005-01-27 21:50:06 +0000
commit5f0962a23387a3d9c5e9fc693f3c3f28df49c3b7 (patch)
treecc43870945ef452c001d3b70d1844eb39600429d
parent4d43341043ae13a58070d1f84395b8381c7833d1 (diff)
downloadpostgresql-5f0962a23387a3d9c5e9fc693f3c3f28df49c3b7.tar.gz
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 67056af8ed..cb0f1f3a45 100644
--- a/contrib/intagg/int_aggregate.c
+++ b/contrib/intagg/int_aggregate.c
@@ -201,6 +201,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 */
@@ -218,6 +222,7 @@ int_enum(PG_FUNCTION_ARGS)
}
pc->num = 0;
fcinfo->context = (Node *) pc;
+ MemoryContextSwitchTo(oldcontext);
}
else /* use an existing one */
pc = (CTX *) fcinfo->context;