| 744 | */ |
| 745 | PG_FUNCTION_INFO_V1(array_abs); |
| 746 | Datum |
| 747 | array_abs(PG_FUNCTION_ARGS){ |
| 748 | if (PG_ARGISNULL(0)) { PG_RETURN_NULL(); } |
| 749 | |
| 750 | ArrayType *v1 = PG_GETARG_ARRAYTYPE_P(0); |
| 751 | |
| 752 | Oid element_type = ARR_ELEMTYPE(v1); |
| 753 | Datum v2 = float8_datum_cast(0, element_type); |
| 754 | |
| 755 | ArrayType *res = General_Array_to_Array(v1, v2, element_abs); |
| 756 | |
| 757 | PG_FREE_IF_COPY(v1, 0); |
| 758 | |
| 759 | PG_RETURN_ARRAYTYPE_P(res); |
| 760 | } |
| 761 | |
| 762 | |
| 763 | /* |
nothing calls this directly
no test coverage detected