diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2005-01-27 21:50:15 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2005-01-27 21:50:15 +0000 |
commit | b9fccbb71cf96facdf7045ec5e15be22021fdeff (patch) | |
tree | 38b756e037ffeda5c92cdcfb39830e05219d4992 | |
parent | 3393e65c6dd8f0a1c9ffd16ab1bd6f64ee6f52e8 (diff) | |
download | postgresql-b9fccbb71cf96facdf7045ec5e15be22021fdeff.tar.gz postgresql-b9fccbb71cf96facdf7045ec5e15be22021fdeff.zip |
Now that I look at it, int_array_enum() didn't work either.
-rw-r--r-- | contrib/intagg/int_aggregate.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/contrib/intagg/int_aggregate.c b/contrib/intagg/int_aggregate.c index 67056af8edd..cb0f1f3a452 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; |