title: node-postgres, Connection terminated unexpectedly
body: <p>I'm trying to connect to a remote database using node-postgres.</p>
  
  <p>I can connect using the psql client, but I get the error <code>Connection terminated unexpectedly</code> while trying to run this (with same connection string as in psql client):</p>
  
  <pre><code>const { Pool, Client } = require('pg')
  const connectionString = '...'
  
  const pool = new Pool({
    connectionString: connectionString,
  })
  
  pool.query('SELECT NOW()', (err, res) =&gt; {
    console.log(err, res)
    pool.end()
  })
  
  const client = new Client({
    connectionString: connectionString,
  })
  client.connect()
  
  client.query('SELECT NOW()', (err, res) =&gt; {
    console.log(err, res)
    client.end()
  })
  </code></pre>
  
  <p>I've also been trying to connect with Sequelize ORM, but got the same error.</p>
  
  <p>@EDIT</p>
  
  <p>Using native mode fixed problem for client query using pg, and sequelize</p>
  
  <p><code>const { Pool, Client } = require('pg').native</code></p>