Cuando lo haces
select 2 != any(array[2,3,4]);
?column?
----------
t
2 se comparará con todos los elementos de la matriz y, si hay alguno con el que 2 no es igual, se evaluará como true .
Utilice not id = any(array[2,3,4])
select not 1 = any(array[2,3,4]);
?column?
----------
t
select not 2 = any(array[2,3,4]);
?column?
----------
f
O != all
select 1 != all(array[2,3,4]);
?column?
----------
t
select 2 != all(array[2,3,4]);
?column?
----------
f