[databases]
p0 = port=6666 host=127.0.0.1 dbname=p0 user=bouncer pool_size=2 reserve_pool_size=2
p0a= port=6666 host=127.0.0.1 dbname=p0 pool_size=2 reserve_pool=2
p0x= port=6666 host=127.0.0.1 dbname=p0 min_pool_size=5 pool_size=5
p0y= port=6666 host=127.0.0.1 dbname=p0 min_pool_size=5 pool_size=5 max_db_connections=2
; for testing 'min_pool_size' with forced user
;p0z= port=6666 host=127.0.0.1 dbname=p0 min_pool_size=3 user=pswcheck
p1 = port=6666 host=127.0.0.1 dbname=p1 user=bouncer
p2 = port=6666 host=127.0.0.1 dbname=p0 max_db_connections=4
p3 = port=6666 host=127.0.0.1 dbname=p0 user=bouncer pool_mode=session
p3x = port=6666 host=127.0.0.1 dbname=p0 user=bouncer pool_mode=transaction
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
p4l= port=6666 host=127.0.0.1 dbname=p4 user=longpass
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
p6 = port=6666 host=127.0.0.1 dbname=p6 user=scramuser1 password=foo
p6x= port=6666 host=127.0.0.1 dbname=p6 user=scramuser1 password=wrong
p6y= port=6666 host=127.0.0.1 dbname=p6 user=scramuser1
p6z= port=6666 host=127.0.0.1 dbname=p6 user=scramuser2
p61= port=6666 host=127.0.0.1 dbname=p6 user=scramuser3
p62= port=6666 host=127.0.0.1 dbname=p6
p7a= port=6666 host=127.0.0.1 dbname=p7
p7b= port=6666 host=127.0.0.1 dbname=p7
p7c= port=6666 host=127.0.0.1 dbname=p7
p8 = port=6666 host=127.0.0.1 dbname=p0 connect_query='set enable_seqscan=off; set enable_nestloop=off'
p9 = port=6666 host=127.0.0.1 dbname=postgres server_lifetime=2 user=bouncer

user_passthrough = port=6666 host=127.0.0.1 dbname=p0
user_passthrough2 = port=6666 host=127.0.0.1 dbname=p2
user_passthrough_pool_size2 = port=6666 host=127.0.0.1 dbname=p0 pool_size=2
user_passthrough_pool_size5 = port=6666 host=127.0.0.1 dbname=p0 pool_size=2

pauthz = port=6666 host=127.0.0.1 dbname=p7 auth_user=pswcheck auth_dbname=authdb
authdb = port=6666 host=127.0.0.1 dbname=p1 auth_user=pswcheck

hostlist1 = port=6666 host=127.0.0.1,::1 dbname=p0 user=bouncer
hostlist2 = port=6666 host=127.0.0.1,127.0.0.1 dbname=p0 user=bouncer
hostlist_good_first = port=6666 host=127.0.0.1,127.0.0.3 dbname=p0 user=bouncer load_balance_hosts=disable
hostlist_bad_first = port=6666 host=unresolvable-hostname,127.0.0.1 dbname=p0 user=bouncer load_balance_hosts=disable
load_balance_hosts_update = port=6666 host=127.0.0.1,127.0.0.3 dbname=p0 user=bouncer load_balance_hosts=disable

varcache_change = port=6666 host=127.0.0.1 dbname=p0 client_encoding=SQL_ASCII
non_existing_pg_db = port=6666 host=127.0.0.1 dbname=non_existing_pg_db
conn_limit_db = port=6666 host=127.0.0.1 dbname=p0 max_db_client_connections=2

; Needed for pg_receivewal and pg_basebackup tests until this patch is merged
; in PostgreSQL (and we don't support PG16 anymore):
; https://www.postgresql.org/message-id/flat/CAGECzQTw-dZkVT_RELRzfWRzY714-VaTjoBATYfZq93R8C-auA@mail.gmail.com
replication = port=6666 host=127.0.0.1 dbname=replication

client_limit_db= port=6666 host=127.0.0.1 dbname=p0 max_db_client_connections=2
client_limit_db_auth_passthrough = port=6666 host=127.0.0.1 dbname=p0 auth_user=pswcheck max_db_client_connections=2
; commented out except for auto-database tests
;* = port=6666 host=127.0.0.1

[users]
maxedout = max_user_connections=3
maxedout2 = max_user_connections=2 max_user_client_connections=2
maxedout3 = max_user_client_connections=2
poolsize1 = pool_size=1
respoolsize1 = pool_size=1 reserve_pool_size=2
pswcheck_not_in_auth_file = max_user_client_connections=2

[pgbouncer]
logfile = test.log
pidfile = test.pid

listen_addr = 127.0.0.1
listen_port = 6667
unix_socket_dir = /tmp

auth_type = trust
auth_file = userlist.txt

pool_mode = statement

server_check_delay = 10
max_client_conn = 10
default_pool_size = 5

server_lifetime = 120
server_idle_timeout = 60

tcp_defer_accept = 0
tcp_keepalive = 0

; use a small tcp_socket_buffer so that we trigger EAGAIN more often in tests.
; Otherwise bugs caused by EAGAIN are hard to debug.
tcp_socket_buffer = 4096

;track_extra_parameters is case sensitive.
;bgbouncer will only track the parameters with GUC_REPORT flag set in Postgres
track_extra_parameters = search_path, intervalstyle
ignore_startup_parameters = extra_float_digits
