diff --git a/bitnami/pgbouncer/1/debian-11/rootfs/opt/bitnami/scripts/libpgbouncer.sh b/bitnami/pgbouncer/1/debian-11/rootfs/opt/bitnami/scripts/libpgbouncer.sh index e65efe6c455b..887cd774a18f 100644 --- a/bitnami/pgbouncer/1/debian-11/rootfs/opt/bitnami/scripts/libpgbouncer.sh +++ b/bitnami/pgbouncer/1/debian-11/rootfs/opt/bitnami/scripts/libpgbouncer.sh @@ -213,6 +213,9 @@ pgbouncer_initialize() { if ! is_empty_value "$PGBOUNCER_AUTH_USER"; then database_value+=" auth_user=$PGBOUNCER_AUTH_USER" fi + if ! is_empty_value "$PGBOUNCER_CONNECT_QUERY"; then + database_value+=" connect_query='$PGBOUNCER_CONNECT_QUERY'" + fi ini-file set --section "databases" --key "$PGBOUNCER_DATABASE" --value "$database_value" "$PGBOUNCER_CONF_FILE" local -r -a key_value_pairs=( "listen_port:${PGBOUNCER_PORT}" diff --git a/bitnami/pgbouncer/1/debian-11/rootfs/opt/bitnami/scripts/pgbouncer-env.sh b/bitnami/pgbouncer/1/debian-11/rootfs/opt/bitnami/scripts/pgbouncer-env.sh index 5ef881498c40..b3091b960266 100644 --- a/bitnami/pgbouncer/1/debian-11/rootfs/opt/bitnami/scripts/pgbouncer-env.sh +++ b/bitnami/pgbouncer/1/debian-11/rootfs/opt/bitnami/scripts/pgbouncer-env.sh @@ -61,6 +61,7 @@ pgbouncer_env_vars=( POSTGRESQL_PORT PGBOUNCER_SET_DATABASE_USER PGBOUNCER_SET_DATABASE_PASSWORD + PGBOUNCER_CONNECT_QUERY PGBOUNCER_FORCE_INITSCRIPTS PGBOUNCER_DAEMON_USER PGBOUNCER_DAEMON_GROUP @@ -137,6 +138,7 @@ export POSTGRESQL_HOST="${POSTGRESQL_HOST:-postgresql}" export POSTGRESQL_PORT="${POSTGRESQL_PORT:-5432}" export PGBOUNCER_SET_DATABASE_USER="${PGBOUNCER_SET_DATABASE_USER:-no}" export PGBOUNCER_SET_DATABASE_PASSWORD="${PGBOUNCER_SET_DATABASE_PASSWORD:-no}" +export PGBOUNCER_CONNECT_QUERY="${PGBOUNCER_CONNECT_QUERY:-}" export PGBOUNCER_FORCE_INITSCRIPTS="${PGBOUNCER_FORCE_INITSCRIPTS:-false}" # System settings diff --git a/bitnami/pgbouncer/README.md b/bitnami/pgbouncer/README.md index 3ac8fbce0f82..de96296bbed5 100644 --- a/bitnami/pgbouncer/README.md +++ b/bitnami/pgbouncer/README.md @@ -85,6 +85,8 @@ The Bitnami PgBouncer container requires a running PostgreSQL installation to co - `POSTGRESQL_HOST`: Backend PostgreSQL hostname. Default: **postgresql**. - `POSTGRESQL_PORT`: Backend PostgreSQL port. Default: **5432**. - `PGBOUNCER_SET_DATABASE_USER`: Whether to include the backend PostgreSQL username in the database string. Default **no**. +- `PGBOUNCER_SET_DATABASE_PASSWORD`: Whether to include the backend PostgreSQL password in the database string. Default **no** +- `PGBOUNCER_CONNECT_QUERY`: Query which will be executed after a connection is established. No Defaults. ### Port and address binding