pgBouncer - multiple servers with same username but different password
-
07-03-2021 - |
Question
I have an active pgBouncer setup with one PostgreSQL server.
We are planning to add one more PostgreSQL server to the same pgBouncer. But the problem is that both databases servers have the same username, but with different passwords.
Server1:
- user: admin
- password: admin123
Server2:
- user: admin
- password: admin@213
This feature is already requested here, can someone help me with any possible solutions?
Solution
There is a good workaround at the link in your question.
Another thing you can try is to use auth_user
and auth_query
with pgBouncer so that it fetches the password from the respective database. I am not sure if that works or if pgBouncer caches the password for each user.
Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange