title: How create aggregate function in PostgreSQL
body: <p>how create agggregate function in PostgreSQL ?</p>
  
  <p>I have a query that executes the code below, where I take the sum of two multiplied numbers. But I need an aggregate function to do this, and I've already done it like <code>select agg(vol,pri) from F</code></p>
  
  <pre><code>select sum(Volume*Price) from F
  </code></pre>