| 1142 | } |
| 1143 | |
| 1144 | Datum |
| 1145 | array_agg_array_finalfn(PG_FUNCTION_ARGS) |
| 1146 | { |
| 1147 | Datum result; |
| 1148 | ArrayBuildStateArr *state; |
| 1149 | |
| 1150 | /* cannot be called directly because of internal-type argument */ |
| 1151 | Assert(AggCheckCallContext(fcinfo, NULL)); |
| 1152 | |
| 1153 | state = PG_ARGISNULL(0) ? NULL : (ArrayBuildStateArr *) PG_GETARG_POINTER(0); |
| 1154 | |
| 1155 | if (state == NULL) |
| 1156 | PG_RETURN_NULL(); /* returns null iff no input values */ |
| 1157 | |
| 1158 | /* |
| 1159 | * Make the result. We cannot release the ArrayBuildStateArr because |
| 1160 | * sometimes aggregate final functions are re-executed. Rather, it is |
| 1161 | * nodeAgg.c's responsibility to reset the aggcontext when it's safe to do |
| 1162 | * so. |
| 1163 | */ |
| 1164 | result = makeArrayResultArr(state, CurrentMemoryContext, false); |
| 1165 | |
| 1166 | PG_RETURN_DATUM(result); |
| 1167 | } |
| 1168 | |
| 1169 | Datum |
| 1170 | array_agg_array_combine(PG_FUNCTION_ARGS) |
nothing calls this directly
no test coverage detected