* Remove any occurrences of an element from an array * * If used on a multi-dimensional array this will raise an error. */
| 6515 | * If used on a multi-dimensional array this will raise an error. |
| 6516 | */ |
| 6517 | Datum |
| 6518 | array_remove(PG_FUNCTION_ARGS) |
| 6519 | { |
| 6520 | ArrayType *array; |
| 6521 | Datum search = PG_GETARG_DATUM(1); |
| 6522 | bool search_isnull = PG_ARGISNULL(1); |
| 6523 | |
| 6524 | if (PG_ARGISNULL(0)) |
| 6525 | PG_RETURN_NULL(); |
| 6526 | array = PG_GETARG_ARRAYTYPE_P(0); |
| 6527 | |
| 6528 | array = array_replace_internal(array, |
| 6529 | search, search_isnull, |
| 6530 | (Datum) 0, true, |
| 6531 | true, PG_GET_COLLATION(), |
| 6532 | fcinfo); |
| 6533 | PG_RETURN_ARRAYTYPE_P(array); |
| 6534 | } |
| 6535 | |
| 6536 | /* |
| 6537 | * Replace any occurrences of an element in an array |
nothing calls this directly
no test coverage detected