title: POSTGRES IF statement fails
body: <p>I'm new to conditional statements within postgres. I have the following statement <code>SELECT IF status = 'L' THEN edate ELSEIF status = 'C' THEN 'wrong date' END IF as date FROM campaigns;</code></p>
  
  <p>But I get an error </p>
  
  <pre><code>ERROR:  syntax error at or near "status" at character 11
  LINE 1: SELECT IF status = 'L' THEN edate ELSEIF status = 'C' THEN '...
  </code></pre>
  
  <p>May I use it like this or what am I doing wrong?</p>