2

cannot make simplest pgbouncer / postgresql combo work using default unix sockets.

logged in as foo, with an existent database (created by foo) bar. these work fine:

$ psql bar
$ psql -U foo bar
$ psql -U foo --password bar

in /etc/pgbouncer/userlist.txt:

"foo" "foo"

in /etc/pgbouncer/pgbouncer.ini:

[databases]
mydb =

[pgbouncer]
unix_socket_dir = /var/run/postgresql
auth_type = trust
auth_file = /etc/pgbouncer/userlist.txt

when I try to login with psql -p 6432 mydb or with psql -p 6432 mydb --password, after entering password, I get

psql: ERROR:  Peer authentication failed for user "foo"

1 Answer 1

2

log in to psql with password anr run "show hba_file;" the vi the pg_hba.conf file - change "local" section to trust for user foo...

or

just before running pgbouncer run export PGPASSWORD='whatever_password_is',

or

create a .pgpass file with saved password...

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.