postgresql column referencing issue
This is what you want,

SELECT t.*, coalesce( m1.desc, m2.desc ) AS desc
FROM transactions AS t
LEFT OUTER JOIN metadata AS m1
  ON (m1.attribute = 'Name' AND t.name = m1.value )
LEFT OUTER JOIN metadata AS m2
  ON (m2.attribute = 'EmpID' AND t.empid = m2.value );


What we do is join twice once for each join condition.