title: Right query to get the current number of connections in a PostgreSQL DB
body: <p>Which of the following two is more accurate?</p>
  
  <pre><code>select numbackends from pg_stat_database;
  
  select count(*) from pg_stat_activity;
  </code></pre>