title: PostgreSQL function for each row
body: <p>I have a query which return to me a table like that:</p>
  
  <pre><code>id | VAL | Type
  -- | --- | ----
  1  | 10  |  A
  2  | 20  |  B 
  3  | 30  |  C
  4  | 40  |  B
  </code></pre>
  
  <p>I want to call some function for each row, which will check type and do some stuff for each type, like IF in C#:</p>
  
  <pre><code>if(type=='A'){}
  if(type=='B'){}
  if(type=='C'){}
  </code></pre>
  
  <p>How can I make these 2 things in Postgresql using only sql?</p>