class PG::Connection

def connect_to_hosts(*args)

def connect_to_hosts(*args)
string = parse_connect_args(*args)
 PG::Connection.conninfo_parse(option_string).each_with_object({}){|h, o| o[h[:keyword].to_sym] = h[:val] if h[:val] }
 PG::Connection.conndefaults.each_with_object({}){|h, o| o[h[:keyword].to_sym] = h[:val] if h[:val] }.merge(iopts)
BUNDLED_LIBPQ_WITH_UNIXSOCKET && iopts[:host].to_s.empty? && iopts[:hostaddr].to_s.empty?
 distors patch the hardcoded default UnixSocket path in libpq to /var/run/postgresql instead of /tmp .
imply try them all.
:host] = "/var/run/postgresql" + # Ubuntu, Debian, Fedora, Opensuse
n/postgresql" + # Alpine, Archlinux, Gentoo
p" # Stock PostgreSQL
or_reset = iopts
s[:hostaddr]
addr is provided -> no need to resolve hostnames
opts[:host] && !iopts[:host].empty? && PG.library_version >= 100000
= resolve_hosts(iopts)
ost given
self.connect_start(iopts) or
raise(PG::Error, "Unable to create a new connection")
G::ConnectionBad, conn.error_message if conn.status == PG::CONNECTION_BAD
the connection options for conn.reset
stance_variable_set(:@iopts_for_reset, iopts_for_reset)
nd(:async_connect_or_reset, :connect_poll)