psequel icon indicating copy to clipboard operation
psequel copied to clipboard

Feature request: allow connecting over unix sockets

Open Vinnl opened this issue 2 months ago • 1 comments

I recently adopted devenv.sh, and by default, the Postgres servers that it starts only accept connections over unix sockets. If it's already possible to connect to those using tarug, it's not obvious to me how to 😅

Vinnl avatar Oct 20 '25 14:10 Vinnl

@Vinnl I don't know much about unix domain socket. From libpq docs (what tarug use to conect), you can put absolute path to the "Host" field

If the host name starts with @, it is taken as a Unix-domain socket in the abstract namespace (currently supported on Linux and Windows). The default behavior when host is not specified, or is empty, is to connect to a Unix-domain socket in /tmp (or whatever socket directory was specified when PostgreSQL was built). On Windows, the default is to connect to localhost.

How would you connect to postgres using unix domain socket with psql tools? That could give some hint.

You can see the code that's build the connection string here: https://github.com/ppvan/tarug/blob/73c9e8f52fe1e48e0c20fc8c1d6513287841a969/src/models/Connection.vala#L90-L107

Feel free to open a PR if you're able to

ppvan avatar Oct 20 '25 14:10 ppvan