Dockerfile add target_session_attrs for postgresql conection settings


docker image support multiple postgresql hosts separated by comma sign for failover purpouse

DB_ADDR : Specify hostname of the database (optional). For postgres only, you can provide a list of hostnames separated by comma to failover alternative host. The hostname can be the host only or pair of host and port, as example host1,host2 or host1:5421,host2:5436 or host1,host2:5000. And keycloak will append DB_PORT (if specify) to the hosts without port, otherwise it will append the default port 5432, again to the address without port only.

Is it possible to implement target_session_attrs in connection setting so we can have easy HA setup?

host=host1 target_session_attrs=any
host=host1,host2 port=port1,port2 target_session_attrs=any

I completely missed that this connection params can be pass via JDBC_PARAMS (this is not documented on docker hub page but i found example on github page in docker-compose example files).