title: Run a query with a LIMIT/OFFSET and also get the total number of rows
body: <p>For pagination purposes, I need a run a query with the <code>LIMIT</code> and <code>OFFSET</code> clauses. But I also need a count of the number of rows that would be returned by that query without the <code>LIMIT</code> and <code>OFFSET</code> clauses.</p>
  
  <p>I want to run:</p>
  
  <pre><code>SELECT * FROM table WHERE /* whatever */ ORDER BY col1 LIMIT ? OFFSET ?
  </code></pre>
  
  <p>And:</p>
  
  <pre><code>SELECT COUNT(*) FROM table WHERE /* whatever */
  </code></pre>
  
  <p>At the same time.  Is there a way to do that, particularly a way that lets Postgres optimize it, so that it's faster than running both individually?</p>