Re: [HACKERS] DETOASTing in custom memory context

2003-10-27 Thread strk
tgl wrote: > strk <[EMAIL PROTECTED]> writes: > >> From whitin an aggregate sfunc I did: > > oldcontext = MemoryContextSwitchTo(fcinfo->flinfo->fn_mcxt); > > geom = (GEOMETRY *)PG_DETOAST_DATUM(datum); > > MemoryContextSwitchTo(oldcontext); > > > And later in aggregate's fi

Re: [HACKERS] DETOASTing in custom memory context

2003-10-27 Thread Tom Lane
strk <[EMAIL PROTECTED]> writes: >> From whitin an aggregate sfunc I did: > oldcontext = MemoryContextSwitchTo(fcinfo->flinfo->fn_mcxt); > geom = (GEOMETRY *)PG_DETOAST_DATUM(datum); > MemoryContextSwitchTo(oldcontext); > And later in aggregate's finalfunc: > pfree(ge

Re: [HACKERS] DETOASTing in custom memory context

2003-10-27 Thread strk
>From whitin an aggregate sfunc I did: oldcontext = MemoryContextSwitchTo(fcinfo->flinfo->fn_mcxt); geom = (GEOMETRY *)PG_DETOAST_DATUM(datum); MemoryContextSwitchTo(oldcontext); And later in aggregate's finalfunc: pfree(geom); Result: segfault! What's wro