pg.connect not a function? : <p>There appears to be a lot of documentation (e.g. <a href="https://devcenter.heroku.com/articles/heroku-postgresql#connecting-in-node-js" rel="noreferrer">https://devcenter.heroku.com/articles/heroku-postgresql#connecting-in-node-js</a>, but also elsewhere including this site) indicating that the proper method of connecting with the pg.js Node package is using pg.connect.  However, I attempted (after previous problems with my actual code) to test by using the exact code shown on the aforementioned Heroku documentation:</p>

<pre><code>var pg = require('pg');

pg.defaults.ssl = true;
pg.connect(process.env.DATABASE_URL, function(err, client) {
  if (err) throw err;
  console.log('Connected to postgres! Getting schemas...');

  client
    .query('SELECT table_schema,table_name FROM information_schema.tables;')
    .on('row', function(row) {
      console.log(JSON.stringify(row));
    });
});
</code></pre>

<p>And I got the error message "pg.connect is not a function".  What is going on, and how do I fix it?</p>
