| 519 | */ |
| 520 | PG_FUNCTION_INFO_V1(array_min); |
| 521 | Datum |
| 522 | array_min(PG_FUNCTION_ARGS){ |
| 523 | if (PG_ARGISNULL(0)) { PG_RETURN_NULL(); } |
| 524 | |
| 525 | ArrayType *v = PG_GETARG_ARRAYTYPE_P(0); |
| 526 | Oid element_type = ARR_ELEMTYPE(v); |
| 527 | Datum res = General_Array_to_Element(v, Float8GetDatum(0), get_float8_infinity(), |
| 528 | element_min, noop_finalize); |
| 529 | |
| 530 | PG_FREE_IF_COPY(v, 0); |
| 531 | |
| 532 | return float8_datum_cast(DatumGetFloat8(res), element_type); |
| 533 | } |
| 534 | |
| 535 | /* |
| 536 | * This function returns maximum of the array elements. |
nothing calls this directly
no test coverage detected