Default: 5432
-### user, password
+### user
If `user=` is set, all connections to the destination database will be
done with the specified user, meaning that there will be only one pool
Otherwise PgBouncer tries to log into the destination database with client
username, meaning that there will be one pool per user.
+### password
+
The length for `password` is limited to 128 characters maximum.
+If no password is specified here, the password from the `auth_file` or
+`auth_query` will be used.
+
### auth_user
Override of the global `auth_user` setting, if specified.
p0 = port=6666 host=127.0.0.1 dbname=p0 user=bouncer pool_size=2
p1 = port=6666 host=127.0.0.1 dbname=p1 user=bouncer
p3 = port=6666 host=127.0.0.1 dbname=p0 user=bouncer pool_mode=session
-p4 = port=6666 host=127.0.0.1 dbname=p4 user=muser1 password=foo
-p4x= port=6666 host=127.0.0.1 dbname=p4 user=muser1 password=wrong
+p4 = port=6666 host=127.0.0.1 dbname=p4 user=puser1 password=foo
+p4x= port=6666 host=127.0.0.1 dbname=p4 user=puser1 password=wrong
+p4y= port=6666 host=127.0.0.1 dbname=p4 user=puser1
+p4z= port=6666 host=127.0.0.1 dbname=p4 user=puser2
p5 = port=6666 host=127.0.0.1 dbname=p5 user=muser1 password=foo
p5x= port=6666 host=127.0.0.1 dbname=p5 user=muser1 password=wrong
+p5y= port=6666 host=127.0.0.1 dbname=p5 user=muser1
+p5z= port=6666 host=127.0.0.1 dbname=p5 user=muser2
authdb = port=6666 host=127.0.0.1 dbname=p1 auth_user=pswcheck
psql -X -o /dev/null -p $PG_PORT -c "create user pswcheck with superuser createdb password 'pgbouncer-check';" p0 || exit 1
psql -X -o /dev/null -p $PG_PORT -c "create user someuser with password 'anypasswd';" p0 || exit 1
psql -X -o /dev/null -p $PG_PORT -c "create user muser1 password 'foo';" p0 || exit 1
+ psql -X -o /dev/null -p $PG_PORT -c "create user muser2 password 'wrong';" p0 || exit 1
+ psql -X -o /dev/null -p $PG_PORT -c "create user puser1 password 'foo';" p0 || exit 1
+ psql -X -o /dev/null -p $PG_PORT -c "create user puser2 password 'wrong';" p0 || exit 1
}
echo "Starting bouncer"
test_password_server() {
admin "set auth_type='trust'"
- # good password
+ # good password from ini
psql -X -c "select 1" p4 || return 1
- # bad password
+ # bad password from ini
psql -X -c "select 2" p4x && return 1
+ # good password from auth_file
+ psql -X -c "select 1" p4y || return 1
+ # bad password from auth_file
+ psql -X -c "select 1" p4z && return 1
+
return 0
}
test_md5_server() {
admin "set auth_type='trust'"
- # good password
+ # good password from ini
psql -X -c "select 1" p5 || return 1
- # bad password
+ # bad password from ini
psql -X -c "select 2" p5x && return 1
+ # good password from auth_file
+ psql -X -c "select 1" p5y || return 1
+ # bad password from auth_file
+ psql -X -c "select 1" p5z && return 1
+
return 0
}