User Tools

Site Tools


soft:pgbouncer

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
soft:pgbouncer [2019/08/07 16:22]
phil created
soft:pgbouncer [2019/08/07 19:12] (current)
phil
Line 66: Line 66:
 [databases] [databases]
 # You will need max_db_connections=1 on template1 database, otherwise multiple connections to the template1 database will not allow running "createdb" through pgbouncer # You will need max_db_connections=1 on template1 database, otherwise multiple connections to the template1 database will not allow running "createdb" through pgbouncer
-# Also for unknown reason, not setting auth_user here don't work+# Also for unknown reason, not repeating auth_user here don't work
 template1 = auth_user=pgbouncer max_db_connections=1 template1 = auth_user=pgbouncer max_db_connections=1
 # connect all other database through unix socket # connect all other database through unix socket
Line 110: Line 110:
 % PGPASSWORD=wrong psql -p 6432 -U foo -d template1 -c 'select current_user;' % PGPASSWORD=wrong psql -p 6432 -U foo -d template1 -c 'select current_user;'
 psql: ERROR:  auth failed psql: ERROR:  auth failed
 +
 +% PGPASSWORD=bar createdb -p 6432 -U bar bar
 +createdb: database creation failed: ERROR:  permission denied to create database
 +
 +% PGPASSWORD=foo createdb -p 6432 -U foo foo
 +
 +% PGPASSWORD=foo psql -p 6432 -U foo -d foo -c 'select current_user;'
 + current_user 
 +--------------
 + foo
 +(1 row)
 +
 +% PGPASSWORD=secret psql -p 6432 -U pgbouncer -d pgbouncer -c 'show databases'
 +   name    | host | port | database  | force_user | pool_size | reserve_pool | pool_mode | max_connections | current_connections | paused | disabled 
 +-----------+------+------+-----------+------------+-----------+--------------+-----------+-----------------+---------------------+--------+----------
 + pgbouncer |      | 6432 | pgbouncer | pgbouncer  |         2 |            0 | statement |               0 |                   0 |      0 |        0
 + template1 |      | 5432 | template1 |            |        20 |            0 |                         1 |                   0 |      0 |        0
 +(2 rows)
 +
 </code> </code>
soft/pgbouncer.1565194942.txt.gz ยท Last modified: 2019/08/07 16:22 by phil