I'm able to start the service with pgenv and pg_ctl but cannot connect with psql. The following error shows:
$ psql -l
psql: error: connection to server on socket "/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
Is the server running locally and accepting connections on that socket?
I checked the path of the mentioned socket but it does not exist as psql reports.
If I use pg_ctl status, the following is returned:
$ pg_ctl: server is running (PID: 2127388)
/home/postgres/Repositories/github.com/theory/pgenv/pgsql-15.2/bin/postgres
I checked the server.log file and it says that is listening on a different socket. Please see the following:
$ file /tmp/.s.PGSQL.5432
/tmp/.s.PGSQL.5432: socket
How can I troubleshoot this?