The following query:
SELECT ARRAY[[1,2,3], [4,5,6], [7,8,9]] @> ARRAY[2, 3, 5];
gets responded with true and not false as expected, since the array[2, 3, 5]
doesn't exist in the source array. Any ideas how can it happen? Maybe flatten is applied to multidimensional arrays?
It's not answer why, but I've tried to find a way to do what you need, best I've got so far is:
sql fiddle demo
some useful links about arrays in PostgreSQL: