Unix socket for postgres?


I am migrating from MySQL to PostgresQL. My PostgresQL server is setup on my host and vaultwarden in the official docker image. I have setup a volume on /run/postgresql which contain sock file. In my docker compose file I have set up the following value for my DATABASE_URL variable:


When I do so, I get the following error message:

[2022-08-29 07:26:09.243][vaultwarden::util][WARN] Can't connect to database, retrying: DieselCon.
[CAUSE] BadConnection(
    "could not translate host name \"unix\" to address: Name or service not known\n",

I have found nothing on Internet, any help is welcome. What’s the correct way of connecting to a database via unix socket files?

I don’t think DIesel supports sockets for PostgreSQL.
So i would suggest to use an TCP connection instead.