SQL

Where

  • where an element in the array

e.g. Given permissions's type is []text - {do_a,do_b,can_do_thing}, get all users with can_do_thing in permissions.

select *
from users
where 'can_do_thing' = ANY("permission")