title: PostgreSQL Type Method
body: <p>How do I create type methods in PostgreSQL?<br>
  Lets take the following type for example:</p>
  
  <pre><code>create type Employee as (
  name varchar(20),
  salary integer)
  </code></pre>
  
  <p>How do I do this?</p>
  
  <pre><code>create method giveraise (percent integer) for Employee
  begin
  set self.salary = self.salary + (self.salary * percent) / 100;
  end
  </code></pre>