title: Equivalent of FOUND_ROWS() function in Postgresql
body: <p>I am doing some paging in my application, returning 20 rows from the database at a time using PostgreSQL's standard OFFSET and LIMIT keywords.  For instance, to get page 1 page:</p>
  
  <pre><code>SELECT stuff FROM table WHERE condition ORDER BY stuff OFFSET 0 LIMIT 20
  </code></pre>
  
  <p>It is a requirement of the application that we also show to the user the total number of records.  So, obviously, I can get the total by issuing a separate query:</p>
  
  <pre><code>SELECT COUNT(*) FROM table WHERE condition
  </code></pre>
  
  <p>But if there are a large number of rows then this is not an optimal solution.  I notice that MySQL has a very useful function called FOUND_ROWS() that does exactly what I am looking for:</p>
  
  <p><a href="http://dev.mysql.com/doc/refman/5.0/en/information-functions.html#function%5Ffound-rows" rel="noreferrer">http://dev.mysql.com/doc/refman/5.0/en/information-functions.html#function%5Ffound-rows</a></p>
  
  <p>Is there an equivalent in PostgreSQL?</p>