mirror of
https://github.com/zabbix/zabbix-docker.git
synced 2025-08-09 00:24:58 +02:00
Add option to use implicit search path in postgres
This commit is contained in:
@ -120,6 +120,10 @@ By default, values for `POSTGRES_USER` and `POSTGRES_PASSWORD` are `zabbix`, `za
|
||||
|
||||
The variable is Zabbix database name. By default, value is `zabbix`.
|
||||
|
||||
### `POSTGRES_USE_IMPLICIT_SEARCH_PATH`
|
||||
|
||||
In some setups, for example including [PgBouncer](https://www.pgbouncer.org), setting the `search_path` via connection parameters fails. If this variable is set to `"true"`, the image skips setting the `search_path` and trusts that the `search_path` of the Zabbix user is setup correctly in PostgreSQL database.
|
||||
|
||||
### `ZBX_HISTORYSTORAGEURL`
|
||||
|
||||
History storage HTTP[S] URL. This parameter is used for Elasticsearch setup. Available since 3.4.5.
|
||||
|
@ -75,6 +75,8 @@ check_variables() {
|
||||
: ${DB_SERVER_SCHEMA:="public"}
|
||||
|
||||
DB_SERVER_DBNAME=${POSTGRES_DB:-"zabbix"}
|
||||
|
||||
: ${POSTGRES_USE_IMPLICIT_SEARCH_PATH:="false"}
|
||||
}
|
||||
|
||||
check_db_connect() {
|
||||
@ -103,8 +105,8 @@ check_db_connect() {
|
||||
fi
|
||||
|
||||
WAIT_TIMEOUT=5
|
||||
|
||||
if [ -n "${DB_SERVER_SCHEMA}" ]; then
|
||||
|
||||
if [ "${POSTGRES_USE_IMPLICIT_SEARCH_PATH,,}" == "false" ] && [ -n "${DB_SERVER_SCHEMA}" ]; then
|
||||
PGOPTIONS="--search_path=${DB_SERVER_SCHEMA}"
|
||||
export PGOPTIONS
|
||||
fi
|
||||
|
Reference in New Issue
Block a user