Project: Crunchy Postgres Operator (App Definition and Development / Database)
File: config.md

<!-- Copyright 2021 - 2024 Crunchy Data Solutions, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> PgBouncer is configured through INI files. It will reload these files when receiving a `HUP` signal or in the admin console. There is a available in the admin console, but it is not clear when those changes take affect. https://www.pgbouncer.org/config.html The allows one file to refer other existing files. There are three sections in the files: `[pgbouncer]` is for settings that apply to the PgBouncer process. `[databases]` is a list of databases to which clients can connect. `[users]` changes a few database settings based on the client user. ``` psql (12.6, server 1.15.0/bouncer) pgbouncer=# SHOW CONFIG; key | value | default | changeable +--+--+ admin_users | | | yes applicationnameadd_host | 0 | 0 | yes auth_file | | | yes authhbafile | | | yes authquery | SELECT usename, passwd FROM pgshadow WHERE usename=$1 | SELECT usename, passwd FROM pg_shadow WHERE usename=$1 | yes auth_type | md5 | md5 | yes auth_user | | | yes autodbidletimeout | 3600 | 3600 | yes clientidletimeout | 0 | 0 | yes clientlogintimeout | 60 | 60 | yes clienttlsca_file | | | no clienttlscert_file | | | no clienttlsciphers | fast | fast | no clienttlsdheparams | auto | auto | no clienttlsecdhcurve | auto | auto | no clienttlskey_file | | | no clienttlsprotocols | secure | secure | no clienttlssslmode | disable | disable | no conffile |

| | yes defaultpoolsize | 20 | 20 | yes disable_pqexec | 0 | 0 | no dnsmaxttl | 15 | 15 | yes dnsnxdomainttl | 15 | 15 | yes dnszonecheck_period | 0 | 0 | yes idletransactiontimeout | 0 | 0 | yes ignorestartupparameters | | | yes job_name | pgbouncer | pgbouncer | no listen_addr | * | | no listen_backlog | 128 | 128 | no listen_port | 6432 | 6432 | no log_connections | 1 | 1 | yes log_disconnections | 1 | 1 | yes logpoolererrors | 1 | 1 | yes log_stats | 1 | 1 | yes logfile | | | yes maxclientconn | 100 | 100 | yes maxdbconnections | 0 | 0 | yes maxpacketsize | 2147483647 | 2147483647 | yes maxuserconnections | 0 | 0 | yes minpoolsize | 0 | 0 | yes pidfile | | | no pkt_buf | 4096 | 4096 | no pool_mode | session | session | yes query_timeout | 0 | 0 | yes querywaittimeout | 120 | 120 | yes reservepoolsize | 0 | 0 | yes reservepooltimeout | 5 | 5 | yes resolv_conf | | | no sbuf_loopcnt | 5 | 5 | yes servercheckdelay | 30 | 30 | yes servercheckquery | select 1 | select 1 | yes serverconnecttimeout | 15 | 15 | yes serverfastclose | 0 | 0 | yes serveridletimeout | 600 | 600 | yes server_lifetime | 3600 | 3600 | yes serverloginretry | 15 | 15 | yes serverresetquery | DISCARD ALL | DISCARD ALL | yes serverresetquery_always | 0 | 0 | yes serverroundrobin | 0 | 0 | yes servertlsca_file | | | no servertlscert_file | | | no servertlsciphers | fast | fast | no servertlskey_file | | | no servertlsprotocols | secure | secure | no servertlssslmode | disable | disable | no so_reuseport | 0 | 0 | no stats_period | 60 | 60 | yes stats_users | | | yes suspend_timeout | 10 | 10 | yes syslog | 0 | 0 | yes syslog_facility | daemon | daemon | yes syslog_ident | pgbouncer | pgbouncer | yes tcpdeferaccept | 1 | | yes tcp_keepalive | 1 | 1 | yes tcp_keepcnt | 0 | 0 | yes tcp_keepidle | 0 | 0 | yes tcp_keepintvl | 0 | 0 | yes tcpsocketbuffer | 0 | 0 | yes tcpusertimeout | 0 | 0 | yes unixsocketdir | /tmp | /tmp | no unixsocketgroup | | | no unixsocketmode | 511 | 0777 | no user | | | no verbose | 0 | | yes (84 rows) ```