1

I changed the port of Postgres to 2345 and I have the socket in:

/tmp/.s.PGSQL.2345

If I run psql I get this error:

psql: error: connection to server on socket "/tmp/.s.PGSQL.5432" failed: No such file or directory

how to pass the socket path?

1 Answer 1

2

You need to use -p option

psql -p 2345
2
  • that works but is using TCP or the socket?
    – nbari
    Feb 10, 2022 at 14:08
  • since you don't provide a host --host=.. psql uses its predefined socket directory by default. which is /tmp in rhel / centos etc
    – Sahap Asci
    Feb 10, 2022 at 14:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.