PGHOSTADDR
PGHOSTADDR is an environment variable used by PostgreSQL client libraries, notably libpq, to specify the host address to connect to. When set, libpq uses the provided address as the destination for the TCP/IP connection and bypasses DNS resolution for the host name given in PGHOST or the connection string. This can improve connection reliability and predictability in environments where DNS is slow, unreliable, or where precise routing is required.
Usage and scope: PGHOSTADDR expects a numeric IP address, either IPv4 (for example 203.0.113.5) or IPv6 (for
Behavior in relation to PGHOST: If PGHOST is set to a hostname, setting PGHOSTADDR overrides the DNS
Security and usage notes: Since environment variables can be read by processes and users with access, exposing