title: How to find the rows count returned from db.Query postgres
body: <p>I am using goLang lib/pq driver and trying to fetch rows from database.</p>
  
  <pre><code>rows, err := db.Query("select id, name from mytable limit 5")
  </code></pre>
  
  <p>I want to have a if else clause which checks if there are rows in result set and I did this:</p>
  
  <pre><code>if(!rows.Next()){
     log.Printf("no rows returned")
  } else {
     log.Printf("rows returned")
  }
  </code></pre>
  
  <p>but this always return me 1 record less and I assume its because of the <code>if</code> clause it skips one record because as soon as I remove <code>if</code> clause I get all records correctly. How can I know the count of rows returned from the select query without executing another query?</p>