May 2018
Intermediate to advanced
576 pages
30h 25m
English
The Listing databases on this database server recipe in Chapter 2, Exploring the Database, shows you how to list the available databases on the current database server, using either the \l meta-command or a couple of equivalent variations. Unfortunately, that doesn't work when using PgBouncer, for the very good reason that the current database server cannot know the answer.
We need to ask PgBouncer instead, and we do so by using the SHOW command when connected to the pgbouncer special administrative database:
myfirstdb=# \c pgbouncerpsql (10.1, server 1.8.1/bouncer)You are now connected to database "pgbouncer" as user "postgres".pgbouncer=# show databases; name | host | port | database | force_user | pool_size | reserve_pool ...