You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, pgcat requires clients to use poolname as database name in their connectionstring, which is really limiting its use.
How about have a default pool, then any database name in the provided connectionstring does not have a matching pool name will use the default pool? And the default pool will simply connect to the database specified in the connectionstring, and ignore the database specified in shard config.
together with the auth_query feature, this could solve a lot problems.
Ensure that your database and the user associated with that database name match.
Below is the config for setting the pool on pgcat
[pools.pgml]
auth_query="SELECT usename, passwd FROM pg_shadow WHERE usename='$1'"
# Be sure to grant this user LOGIN on Postgres
auth_query_user = "postgres"
auth_query_password = "postgres"
proxy = true
The below config is to point the pgcat pool to the PostgreSQL database cluster.
Activity
rvsoni commentedon Jun 22, 2025
Hello @szguoxz
Can you check my implementation of PGBouncer like proxy using
auth_querybase autnatication with dynamic pool creationhttps://github.com/rvsoni/pgcat
https://hub.docker.com/r/rvsoni/pgcat
bharling commentedon Jun 25, 2025
@rvsoni this looks like it would solve issues I'm facing too - can you provide some guidance on how to get this setup? I'd love to test
rvsoni commentedon Jul 1, 2025
@bharling
You need to use the Docker image https://hub.docker.com/r/rvsoni/pgcat and a config example from https://github.com/rvsoni/pgcat/blob/main/pgcat.toml to start. The most essential config is to use
aut_querybased login for the pool, which dynamically looks up the user and PostgreSQL database from the cluster.Ensure that your database and the user associated with that database name match.
Below is the config for setting the pool on pgcat
The below config is to point the pgcat pool to the PostgreSQL database cluster.