title: Recursive function in postgres
body: <p>How to map below query to postgres function.</p>
  
  <pre><code>WITH RECURSIVE source (counter, product) AS (
  SELECT
  1, 1
  UNION ALL
  SELECT
  counter + 1, product * (counter + 1)
  FROM source
  WHERE
  counter &lt; 10
  )
  SELECT counter, product FROM source;
  </code></pre>
  
  <p>I am new to postgres. I want to achieve same functionality using PL/pgsql function.</p>