pgcat icon indicating copy to clipboard operation
pgcat copied to clipboard

Add support for automatic pool (similar to pgbouncer)

Open pinaraf opened this issue 1 year ago • 7 comments

Is your feature request related to a problem? Please describe. For some applications, it may not be possible to list all databases the application can connect to (for instance when each customer has his own database). For these, it's better to use a feature similar to the automatic pool in pgbouncer, cf. https://www.pgbouncer.org/config.html section databases.

Describe the solution you'd like Be able to describe an automatic pool generator in the configuration.

Describe alternatives you've considered None known

Additional context None

pinaraf avatar Mar 14 '23 10:03 pinaraf

Hi there,

I've never used that feature of PgBouncer. Could you give me an example of how it works?

Thanks!

levkk avatar Mar 14 '23 17:03 levkk

Hi

In pgbouncer.ini:

[databases]
* = host=my.server.org port=5432

When a client connects to the bouncer and asks for the database demo, it will spawn a new pool, named demo, for the database demo on my.server.org:5432. If the client disconnects, the pool will remain "forever" or until autodb_idle_timeout is reached. The usual server_idle_timeout and server_lifetime rules apply.

Regards

pinaraf avatar Mar 14 '23 19:03 pinaraf

+1 for this feature. I specifically need users wildcards.

adriangb avatar Jan 31 '24 23:01 adriangb

+1 for this feature, without it there ends up being a lot of boilerplate and manual upkeep in an environment with a large number of databases and users.

AndrewJackson2020 avatar Apr 26 '24 16:04 AndrewJackson2020

Hi +1 for this feature

strelkovia avatar May 31 '24 08:05 strelkovia

Hallo! +1 from me too please, this would be really useful

bharling avatar Aug 14 '24 14:08 bharling