PostgreSQL DSN for password-less connection over UNIX socket?


I am wondering if anyone was able to use PostgreSQL database via UNIX socket and user without password?

It seems that existing DSN format is wrong because it doesn’t allow empty password?

PostgreSQL: Documentation: 15: 34.1. Database Connection Control Functions says that
:password part should be optional:


where userspec is:


But maybe there is a workaround?

I was wrong. It seems that sqlx and pq allow user: (with empty password) and my issue was caused by a bit different thing.

I was able to solve UNIX socket connection by specifying @ as an endpoint::

temporal-sql-tool --plugin postgres --endpoint @ --port 5432 --user foo --database foo --ca host=/var/run/postgresql setup-schema -v 0.0