title: pg-promise - Example with procedure
body: <p>I use <a href="https://github.com/vitaly-t/pg-promise" rel="nofollow noreferrer">pg-promise</a> for several projects. I read this:</p>
  <blockquote>
  <h1>Functions and Procedures</h1>
  <p>In PostgreSQL stored procedures are just functions that usually do not return anything.</p>
  <p>Suppose we want to call function findAudit to find audit records by user_id and   maximum timestamp. We can make such call as shown below:</p>
  </blockquote>
  <pre><code>db.func('findAudit', [123, new Date()])
    .then(function (data) {
      console.log(data); // printing the data returned
  })
    .catch(function (error) {
      console.log(error); // printing the error
  });
  </code></pre>
  <p>The documentation provides examples except for this two functions. (Notice : excellent documentation otherwise)</p>
  <p>Can someone provide an example for Procedure with <a href="https://github.com/vitaly-t/pg-promise" rel="nofollow noreferrer">pg-promise</a>?</p>
  <p>PS: I know what is a stored-procedure in Postgresql but I didn't find example with <a href="https://github.com/vitaly-t/pg-promise" rel="nofollow noreferrer">pg-promise</a> (one who could fail/sucess) ...</p>
  <p>Thanks</p>