0

would you be so kind to advise how to connect to pgbouncer's internal database ?

I try to follow the community instructions here: https://www.depesz.com/2012/12/02/what-is-the-point-of-bouncing/ and more specifically:

$ sudo -i -u postgres
[sudo] password for xxx: 
-bash-4.2$ psql --dbname=pgbouncer  --host=x.x.x.x --port=15434
psql: ERROR:  no such user: postgres

But I don't know what I am doing wrong. The postgres user should be internal one.

EDIT: as a postgres user if I list all databases present, I get

postgres=# \l
                                  List of databases
   Name    |  Owner   | Encoding |   Collate   |    Ctype    |   Access privileges   
-----------+----------+----------+-------------+-------------+-----------------------
 metabase  | postgres | UTF8     | en_GB.UTF-8 | en_GB.UTF-8 | 
 postgres  | postgres | UTF8     | en_GB.UTF-8 | en_GB.UTF-8 | 
 registry  | postgres | UTF8     | en_GB.UTF-8 | en_GB.UTF-8 | 
 template0 | postgres | UTF8     | en_GB.UTF-8 | en_GB.UTF-8 | =c/postgres          +
           |          |          |             |             | postgres=CTc/postgres
 template1 | postgres | UTF8     | en_GB.UTF-8 | en_GB.UTF-8 | postgres=CTc/postgres+
           |          |          |             |             | =c/postgres
(5 rows)
nskalis
  • 2,232
  • 8
  • 30
  • 49
  • pgBouncers is just a connection pooler. it does not have an "internal database". It simply forwards connections to the database(s) you created. –  Jun 18 '19 at 12:37

1 Answers1

1

STEP 1: Check the current running process by using this command sudo lsof -i :5439 "5439" is nothing but DB port.

STEP 2: kill all the running process by this command sudo kill -9 2911 2911- running process. make sure that you killed all running process. To confirm that again use the above command and press enter.

STEP 3: finally connect by using this command psql -h X.X.X.X -u pguser -d pgbouncer -p 5439

"h"-host private ip, "u"-username, "d"-database name, "p"-db port.

Community
  • 1
  • 1
  • To know about it please refer this blog [link](https://medium.com/tensult/pgbouncer-routing-and-rewriting-for-postgresql-using-python-14b12d6595d). If you have any queries please let me know. – Akash Srinivasan Jul 01 '19 at 10:06