I am trying to set up connectional pooling using pgbouncer 1.7.2 for PostgreSQL 9.6 on Windows 10.

Trying to connect to pgbouncer in the cmd

psql -p 6432 -h postgres pgbouncer

gives the error:

psql: server closed the connection unexpectedly Server terminated abnormally before or while processing

The port 6432 is listening and looking in the pg_log there are no errors.

Here is my pgbouncer.ini config file:


mydb = host= port=5432 dbname=mydb


logfile = pgbouncer.log
pidfile = pgbouncer.pid

listen_addr = *
listen_port = 6432

auth_type = md5
auth_file = C:/Program Files/pgbouncer-1.7.2-win32/etc/pgbouncer/userlist.txt

admin_users = postgres, lisam

stats_users = stats, root

Where userlist.txt contains "postgres" "some_password"

In the pgbouncer guide it says:

"Since PostgreSQL 9.0, the text files are not used anymore. Thus the auth file needs to be generated. See ./etc/mkauth.py for sample script to generate auth file from pg_shadow table. PostgreSQL MD5-hidden password format: "md5" + md5(password + username)"

Does anyone know if this is the root of the connection problem and if so how to manually generate the auth file?

Any help would be much appreciated.