PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ pgis_accum_finalfn()

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 182 of file lwgeom_accum.c.

References pgis_abs::a, PG_FUNCTION_INFO_V1(), and pgis_geometry_accum_finalfn().

Referenced by pgis_geometry_accum_finalfn(), pgis_geometry_accum_transfn(), 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().

183 {
184  int dims[1];
185  int lbs[1];
186  ArrayBuildState *state;
187  Datum result;
188 
189  /* cannot be called directly because of internal-type argument */
190  Assert(fcinfo->context &&
191  (IsA(fcinfo->context, AggState) ||
192  IsA(fcinfo->context, WindowAggState))
193  );
194 
195  state = p->a;
196  dims[0] = state->nelems;
197  lbs[0] = 1;
198  result = makeMdArrayResult(state, 1, dims, lbs, mctx, false);
199  return result;
200 }
ArrayBuildState * a
Definition: lwgeom_accum.c:85
Here is the call graph for this function:
Here is the caller graph for this function: