4
votes

I have configured pgbouncer on server A(port 6432, host addr: 10.XX.XX.92) that will accept the connections for postgres server running on server B(port 5433, host addr:10.XX.XX.90). This postgres server has 2 databases.(postgres and db1)

I have 2 different type of users(user1, user2) that will connect to same database(db1). These both users have different set of permissions on db1.

Below is the sample of how I have configured pgbouncer.ini file.

database1 = host=10.XX.XX.90 port=5433 user=user1 password='pwd1' dbname=db1
database2 = host=10.XX.XX.90 port=5433 user=user2 password='pwd2' dbname=db1

Now when I try to connect to this database through pgAdmin it gives me an error of "No such database" .

Below are the connection variables that I used to connect through pgadmin for user1.

host = 10.XX.XX.92
port = 6432
maintenance database = database1
username = user1
password = pwd1

But when I use same variables and try to connect using DBeaver or psql, I am able to connect to the database db1 successfully.

Does anyone know if this is just pgAdmin issue or am I missing something here.

Note: There is one more thing I tried. If in the pgbouncer.ini, I name the database variable(database1) same as actual database name(db1), pg Admin lets me connect to the database. This would have worked for me if I just had one user connecting to the database but I have two users and they both can't have same connection name in the config file.

1
Do you have some sort of port forwarding setup on DBeaver or psql? I've seen this error with port numbers not matching and in your example you have 5433 and 6432.J Spratt
No. I was just able to connect to the database directly without setting up anything explicitly. I think this is something related to maintenance database in pgAdmin but I might be wrong.Esha
I've got the same problem. After all this time did you fix it ? Edit : think I found the answer here stackoverflow.com/a/41500185/5341247SuperPoney

1 Answers

0
votes

Have a try here : https://stackoverflow.com/a/41500185/5341247

add this to your connection string :

EntityAdminDatabase=DATABASE_NAME