How can I choose between Client or Pool for node-postgres

May I know, what thing I should consider, before choosing between Pool or Client?

Use a pool if you have or expect to have multiple concurrent requests. That is literally what it is there for: to provide a pool of re-usable open client instances (reduces latency whenever a client can be reused).

In that case you definitely do not want to call pool.end() when your query completes, you want to reserve that for when your application terminates because pool.end() disposes of all the open client instances. (Remember, the point is to keep up to a fixed number of client instances available.)

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)