Hello, I'd like to set up an connection in pgAdmin4 to the primary host of a replicated Postgres cluster behind an SSH gateway.
To always connect to the primary DB host (without knowing beforehand which one will be primary at the time of connection), I figured I have to create a service file to feed target_session_attrs to libpq. I created such a file, including a service for the ssh tunneled connection (to keep it simple for testing, only IP and port of current primary, no target_session_attrs) and a second service to a DB server reachable without tunneling, also only IP and port. I already have working tunneled connections to each single DB host behind the ssh gateway. My results are: * SSH tunneled connections working fine. In "Register Server/Connection" the fields "Host name" and "Port" are set. * Connection via service to the DB host reachable without ssh working fine. In "Register Server/Connection" the fields "Host name" and "Port" are empty, values from service are used as expected. * Connection via service and ssh tunnel can not be set up. If I try to combine the above (fields "Host name" and "Port" empty, field "Service" set AND enabled SSH tunnel) I get an error "IP is not a string (NoneType)" and I can't proceed. Now after thinking a bit about it -- is it even possible to use libpq- services behind ssh tunneling? If it is possible, how to set up in pgAdmin4? I'd be glad for any hints where to look for further information. Best regards, Jürgen
smime.p7s
Description: S/MIME cryptographic signature