How to check if integer array overlaps with int4range?
You can use the ANY and ALL array element quantifiers, together with the @&gt; contains element range operator.

If you want to know if ANY element of the array lies within your range, which is what, according to your comments, is what I interpret you want, you can use:

SELECT
    int4range(5, 8, '[]') @&gt; ANY(ARRAY[1, 3, 5, 7]) AS some_are_in


(in this case, this will return TRUE, because both 5 and 7 are part of the range)

This nearly translates your request (but reversing it): Does the range contain ANY of the elements of the array?



If you would like to know that they're all in, you'd use ALL instead of ANY:

SELECT
    int4range(5, 8, '[]') @&gt; ALL(ARRAY[1, 3, 5, 7]) AS all_are_in


(in this case, this will return false, because 1 and 3 are not part of the range)

You can find these and some other examples at dbfiddle here