Actually using something IN (<value list>) similar to something = any(array[<value list>]) in PostgreSQL:
postgres=# explain select 1 where 'a' in ('a','b','c'); QUERY PLAN ---------------------------------------------------------- Result (cost=0.00..0.01 rows=1 width=0) One-Time Filter: ('a'::text = ANY ('{a,b,c}'::text[])) (2 rows)
Fortunately, we can use like or even ilike instead of = :
select 1 where 'aa' ilike any(array['%A%','%B%','%C%']); ?column?
So in your case it could be
... state LIKE ANY(ARRAY['%idle%', '%disabled%'])
And an additional advantage: it can be passed as a parameter from the client application.
source share