I tried to run this query in PostgreSQL 10:
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
Got the error:
set-returning functions are not allowed in CASE