| 765 | */ |
| 766 | PG_FUNCTION_INFO_V1(array_sqrt); |
| 767 | Datum |
| 768 | array_sqrt(PG_FUNCTION_ARGS){ |
| 769 | if (PG_ARGISNULL(0)) { PG_RETURN_NULL(); } |
| 770 | |
| 771 | ArrayType *x = PG_GETARG_ARRAYTYPE_P(0); |
| 772 | ArrayType *v1 = array_to_float8_array(x); |
| 773 | Datum v2 = 0; |
| 774 | |
| 775 | ArrayType *res = General_Array_to_Array(v1, v2, element_sqrt); |
| 776 | |
| 777 | if (v1 != x) { pfree(v1); } |
| 778 | PG_FREE_IF_COPY(x, 0); |
| 779 | |
| 780 | PG_RETURN_ARRAYTYPE_P(res); |
| 781 | } |
| 782 | |
| 783 | /* |
| 784 | * This function takes the power for each element. |
nothing calls this directly
no test coverage detected