PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ pgis_accum_finalfn() [1/2]

Datum pgis_accum_finalfn ( pgis_abs p,
MemoryContext  mctx,
__attribute__((__unused__)) FunctionCallInfo  fcinfo 
)

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

Definition at line 184 of file lwgeom_accum.c.

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

References pgis_abs::a.