PostGIS  2.2.7dev-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 168 of file lwgeom_accum.c.

References pgis_abs::a.

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

169 {
170  int dims[1];
171  int lbs[1];
172  ArrayBuildState *state;
173  Datum result;
174 
175  /* cannot be called directly because of internal-type argument */
176  Assert(fcinfo->context &&
177  (IsA(fcinfo->context, AggState) ||
178  IsA(fcinfo->context, WindowAggState))
179  );
180 
181  state = p->a;
182  dims[0] = state->nelems;
183  lbs[0] = 1;
184  result = makeMdArrayResult(state, 1, dims, lbs, mctx, false);
185  return result;
186 }
ArrayBuildState * a
Definition: lwgeom_accum.c:71

Here is the caller graph for this function: