There is a difference between the Postgres and SQLite cases though:
* For SQLite, it is enough to provide the filesystem path to the database.
* For Postgres, you need to provide the address of the database cluster (either a hostname+port or a directory containing unix domain sockets + port) and a database name within the cluster.
It makes a lot of sense to use the path component in the SQLite case. This is less the case for Postgres where we've got two obviously distinct components.
Furthermore, "/some/path/to/a" does not uniquely identify the socket to use. It is a directory that contains unix domain sockets of the form ".s.PGSQL.$PORT". If we treat the socket path as the host portion of the URI component (which is also how Postgres treats it), there is an obvious way to pick non-default port numbers (e.g. postgres://%2fsome%2fpath%2fto%2fa:5433/database). Mixing things up inside the path component just confuses matters.
There is a difference between the Postgres and SQLite cases though:
* For SQLite, it is enough to provide the filesystem path to the database.
* For Postgres, you need to provide the address of the database cluster (either a hostname+port or a directory containing unix domain sockets + port) and a database name within the cluster.
It makes a lot of sense to use the path component in the SQLite case. This is less the case for Postgres where we've got two obviously distinct components.
Furthermore, "/some/path/to/a" does not uniquely identify the socket to use. It is a directory that contains unix domain sockets of the form ".s.PGSQL.$PORT". If we treat the socket path as the host portion of the URI component (which is also how Postgres treats it), there is an obvious way to pick non-default port numbers (e.g. postgres: //%2fsome% 2fpath% 2fto%2fa: 5433/database) . Mixing things up inside the path component just confuses matters.