array_positions ( anycompatiblearray, anycompatible ) → integer[]Returns an array of the subscripts of all occurrences of the second argument in the array given as first argument. The array must be one-dimensional. Comparisons are done using
IS NOT DISTINCT FROM semantics, so it is possible to search for NULL. NULL is returned only if the array is NULL; if the value is not found in the array, an empty array is returned.array_positions(ARRAY['A','A','B','A'], 'A') → {1,2,4}