title: Sequelize Error with query sending Error: read ECONNRESET
body: <p>PostgreSQL 9.6.2 I send query from node.js / express.js application.</p>
  
  <p>The sequelize provide the <a href="http://docs.sequelizejs.com/en/latest/docs/models-usage/#findall-search-for-multiple-elements-in-the-database" rel="nofollow noreferrer">doc how to make the query</a>, this example findAll.</p>
  
  <p>I try to make same example.</p>
  
  <pre><code>console.log('user id: ', req.decoded);
  db.orders.findAll({where: {userId: req.decoded.id}})
      .then(function (orders) {
          console.log('orders from db: ', orders);
      })
      .catch(function (err) {
          console.log('orders request error from db: ', err);
      });
  console.log('end of function');
  </code></pre>
  
  <p>Console log:</p>
  
  <pre><code>user id:  { id: 2 }
  end of function
  orders request error from db:  { SequelizeConnectionError: read ECONNRESET
      at D:\NodeJSProjects\ParkingHouse\node_modules\sequelize\lib\dialects\postgres\connection-manager.js:110:20
      at Connection.&lt;anonymous&gt; (D:\NodeJSProjects\ParkingHouse\node_modules\pg\lib\client.js:186:5)
      at emitOne (events.js:96:13)
      at Connection.emit (events.js:188:7)
      at Socket.&lt;anonymous&gt; (D:\NodeJSProjects\ParkingHouse\node_modules\pg\lib\connection.js:86:10)
      at emitOne (events.js:96:13)
      at Socket.emit (events.js:188:7)
      at emitErrorNT (net.js:1278:8)
      at _combinedTickCallback (internal/process/next_tick.js:74:11)
      at process._tickCallback (internal/process/next_tick.js:98:9)
    name: 'SequelizeConnectionError',
    message: 'read ECONNRESET',
    parent: 
     { Error: read ECONNRESET
         at exports._errnoException (util.js:1022:11)
         at TCP.onread (net.js:569:26) code: 'ECONNRESET', errno: 'ECONNRESET', syscall: 'read' },
    original: 
     { Error: read ECONNRESET
         at exports._errnoException (util.js:1022:11)
         at TCP.onread (net.js:569:26) code: 'ECONNRESET', errno: 'ECONNRESET', syscall: 'read' } }
  </code></pre>
  
  <p>After some time the request is repeated and then I get the data from db.
  I found the similar topic <a href="https://stackoverflow.com/questions/17245881/node-js-econnreset">Node js ECONNRESET</a> but I don't found answer.</p>
  
  <ol>
  <li>Why db close the connection? And how to repair it.</li>
  </ol>