Sunday 23 December 2018

Proper way to release a Postgres Pool connection

I'm learning about PgSQL pooling. I wrote a script using the node-postgres package. Currently it successfully grabs a connection from a pool of 5, executes a query, gets results, and then I'm not sure how to properly release it. It's just a script and I'm running it using node index.js. But when I use pool.release() the script takes longer to exit than when I use pool.release(true). Which way is will release the connection back into the pool, and can you explain the difference between them. Here's a link to the documentation I'm referring to http://bit.ly/2EIf6WN.

Submitted December 23, 2018 at 01:26PM by the_amazing_spork

No comments:

Post a Comment