GeezerVison is showing github.com — Pool min size · Issue #1869 · brianc/node-postgres
DescriptionHi. It seems that min parameter of Pool configuration is not used.
Code
let pool = new Pool({
database: connectionConfig.database,
port: connectionConfig.port,
nolimit: connectionConfig.nolimit,
user: connectionConfig.user,
password: connectionConfig.password,
host: connectionConfig.host,
min: 1
});
Expected:
At least one connection is always established
Actual:
I receive a removed event with pool.totalCount equals to zero. After that my process is terminated. Reacted by Super Snager, IvanBialotski-GBI and Roman Stetsyk Activitycharmander commented on Apr 5, 2019 min doesn’t exist. I don’t think nolimit does either.
krabradosty commented on Apr 6, 2019 Strange, I think it can be useful: e.g. I want to know that there is a problem with a connection to DB before my app come in a state when it needs to perform a query.
Right now when I detect that pool.totalCount is zero, I send SELECT now() to DB to maintain the connection. champikasam commented on Mar 2, 2022 I also have a requirement to maintain a given, minimum number of connections to the database. Is there a known workaround to achieve this? I noticed that PgBouncer supports this but i prefer to use node-postgres if a viable workaround is available. Reacted by Simon Lemieux, andymel and 제이크 gajus commented on Aug 3, 2022 @brianc This would be a nice feature. Any reason it isn't supported given that we can just leverage generic-pool functionality for this?
Would be nice to have this for compatibility with postgres.
gajus/postgres-bridge@2463f7f gajus commented on Aug 3, 2022 Upon a second look, it looks like Pool is not using generic-pool, contrary to what I thought. Smriti-OSS commented on Jun 5, 2023 Hi @brianc Is there any future roadmap to support this feature?? EQuincerot commented on Sep 21, 2026 Resolved by #3438 if I'm correct :)
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|