when to disconnect and when to end a pg client or pool
问题 My stack is node, express and the pg module. I really try to understand by the documentation and some outdated tutorials. I dont know when and how to disconnect and to end a client. For some routes I decided to use a pool. This is my code const pool = new pg.Pool({ user: 'pooluser',host: 'localhost',database: 'mydb',password: 'pooluser',port: 5432}); pool.on('error', (err, client) => { console.log('error ', err); process.exit(-1); }); app.get('/', (req, res)=>{ pool.connect() .then(client =>