title: PostgreSQL error: set-returning functions are not allowed in CASE
body: <p>I tried to run this query in PostgreSQL 10:</p>
  
  <pre><code>select e.errordescription,
         CASE 
          WHEN e.reworkempid is not null THEN get_empname(e.reworkempid) 
          else null 
        end  
  from error_log_gs  e 
  where e.qcworkpackageid=3012175 and e.logno=1 
  </code></pre>
  
  <p>Got the error: </p>
  
  <blockquote>
    <p>set-returning functions are not allowed in CASE</p>
  </blockquote>