MCPcopy Create free account
hub / github.com/apache/cloudberry / array_remove

Function array_remove

src/backend/utils/adt/arrayfuncs.c:6517–6534  ·  view source on GitHub ↗

* Remove any occurrences of an element from an array * * If used on a multi-dimensional array this will raise an error. */

Source from the content-addressed store, hash-verified

6515 * If used on a multi-dimensional array this will raise an error.
6516 */
6517Datum
6518array_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

Callers

nothing calls this directly

Calls 1

array_replace_internalFunction · 0.85

Tested by

no test coverage detected