I need a way to test if a value exists in a given array. So far I came up with something like this
select '{1,2,3}'::int[] @> (ARRAY[]::int[] || value_variable::int)
but I keep thinking there should be a simpler way to this, I just cant see it.
Edit: Just realized I could do this
select '{1,2,3}'::int[] @> ARRAY[value_variable::int]
This is much better and I believe will suffice, but if you have other ways to do it please share.