Skip to content

Error in dbConnect(): linux socket location moved #564

Done

Description

@helmingstay

I'm running Postgres 15 and the current CRAN RPostgres on debian 12.
When I do:

> con <- dbConnect(Postgres())

I get the following:

Error: connection to server on socket "/tmp/.s.PGSQL.5432" failed: No such file or directory
        Is the server running locally and accepting connections on that socket?

I confirmed via psql that the database is running and accessible with current user.
Some poking around:
$ netstat -nlp | grep 5432
shows the socket at /var/run/postgresql/.s.PGSQL.5432

I was able to get a successful dbConnect() after doing:
$ ln -s /var/run/postgresql/.s.PGSQL.5432 /tmp

Activity

  1. krlmlr commented on Nov 29, 2026

    @krlmlr
    Member

    Thanks. A documentation PR is about to merge. Long story short: this looks like a mismatch between the server's and the client library's notion of the default socket path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions