PostgreSQL DSN for password-less connection over UNIX socket?

Hello!

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:

postgresql://[userspec@][hostspec][/dbname][?paramspec]

where userspec is:

user[:password]

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