title: PostgreSQL - check if value is equal to an enum value
body: <p>I have the following enum declaration:<br>
  <code>CREATE TYPE known_roles_list AS ENUM ('role1', 'role2')</code></p>
  
  <p>When the DB executes a certain query, I wish to check if they're doing it with one of these roles, and if not - let the query go through. Something like:  </p>
  
  <pre><code>IF current_user NOT IN known_roles_list THEN
      RETURN OLD; 
  END IF;
  </code></pre>
  
  <p>Obviously, that code above didn't work (raised runtime comparison errors). Nor did <code>unnest()</code>-ing the enum values and searching within them.   </p>
  
  <p>How can I make that search - and see if <em>any</em> of the enum's values match the <code>current_user</code> value? (The <code>current_user</code> value is just an example - later, I need to compare these enum values to a row value, denoted by column)  </p>
  
  <p>Thanks!</p>