title: DELETE query returning count of records deleted
body: <p><em>Using postgres 9.6.</em> </p>
  
  <p>I am attempting to write a function that will delete records and return to the application developer the number of rows that were deleted. I have some the following demo but I keep running into a syntax issue. </p>
  
  <pre><code>BEGIN;
  DELETE FROM it.animals WHERE id &lt;5
  RETURNING COUNT(id);
  ROLLBACK;
  </code></pre>
  
  <blockquote>
    <p>[2020-03-12 09:14:11] [42803] ERROR: aggregate functions are not allowed in RETURNING</p>
  </blockquote>