Uncommon syntax for unix socket connections
The only way to connect to my socket is by passing ?host=/postgres/.s.PGSQL.5432 to my database URL. This is quite unusual as all pieces of software I've worked so far used the socket directory instead. Is this the expected behavior?
I copied how libpq does it: https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNECT-HOST
host Name of host to connect to. If a host name looks like an absolute path name, it specifies Unix-domain communication rather than TCP/IP communication; the value is the name of the directory in which the socket file is stored. (On Unix, an absolute path name begins with a slash.
You can also use PGHOST env variable and leave the connection string almost empty.
See last spec of conninfo_spec.
I copied how libpq does it: https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNECT-HOST
host Name of host to connect to. If a host name looks like an absolute path name, it specifies Unix-domain communication rather than TCP/IP communication; the value is the name of the directory in which the socket file is stored. (On Unix, an absolute path name begins with a slash.
Hi Will, in libpq-connect host is passed as a directory containing the socket, not the socket itself.