PostGIS  2.1.10dev-r@@SVN_REVISION@@
Datum pgis_accum_finalfn ( pgis_abs p,
MemoryContext  mctx,
FunctionCallInfo  fcinfo 
)

The final function rescues the built array from the side memory context using the PostgreSQL built-in function makeMdArrayResult.

Definition at line 143 of file lwgeom_accum.c.

References pgis_abs::a, and result.

Referenced by pgis_geometry_accum_finalfn(), pgis_geometry_collect_finalfn(), pgis_geometry_makeline_finalfn(), pgis_geometry_polygonize_finalfn(), and pgis_geometry_union_finalfn().

144 {
145  int dims[1];
146  int lbs[1];
147  ArrayBuildState *state;
148  Datum result;
149 
150  /* cannot be called directly because of internal-type argument */
151  Assert(fcinfo->context &&
152  (IsA(fcinfo->context, AggState) ||
153  IsA(fcinfo->context, WindowAggState))
154  );
155 
156  state = p->a;
157  dims[0] = state->nelems;
158  lbs[0] = 1;
159  result = makeMdArrayResult(state, 1, dims, lbs, mctx, false);
160  return result;
161 }
ArrayBuildState * a
Definition: lwgeom_accum.c:63
char ** result
Definition: liblwgeom.h:218

Here is the caller graph for this function: