Skip to main content
2 of 3
added 97 characters in body
Cepr0
  • 31.1k
  • 9
  • 82
  • 105

Instead of IN we can use ANY with arrays casted to enum array, for example:

create table example_table (
-- 
   enum_field example_enum,
-- 
);

select 
  * 
from 
  example_table
where
  enum_field = any(array['ENUM1', 'ENUM2']::example_enum[]);

Or we can still use 'IN' clause, but first, we should 'unnest' it:

select 
  * 
from 
  example_table t 
where 
  t.enum_field in (select unnest(array['ENUM1', 'ENUM2']::example_enum[]));
Cepr0
  • 31.1k
  • 9
  • 82
  • 105