postgresml/pgcat

Add support for automatic pool (similar to pgbouncer)

Opened this issue ยท 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

levkk commented

Hi there,

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

Thanks!

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

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

+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.

Hi
+1 for this feature

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

+1 much needed for use-case