* Generic transition function for numeric aggregates that require sumX2. */
| 4827 | * Generic transition function for numeric aggregates that require sumX2. |
| 4828 | */ |
| 4829 | Datum |
| 4830 | numeric_accum(PG_FUNCTION_ARGS) |
| 4831 | { |
| 4832 | NumericAggState *state; |
| 4833 | |
| 4834 | state = PG_ARGISNULL(0) ? NULL : (NumericAggState *) PG_GETARG_POINTER(0); |
| 4835 | |
| 4836 | /* Create the state data on the first call */ |
| 4837 | if (state == NULL) |
| 4838 | state = makeNumericAggState(fcinfo, true); |
| 4839 | |
| 4840 | if (!PG_ARGISNULL(1)) |
| 4841 | do_numeric_accum(state, PG_GETARG_NUMERIC(1)); |
| 4842 | |
| 4843 | PG_RETURN_POINTER(state); |
| 4844 | } |
| 4845 | |
| 4846 | /* |
| 4847 | * Generic combine function for numeric aggregates which require sumX2 |
nothing calls this directly
no test coverage detected