Fixing Connection Issues After Installing PostgreSQL 9.4 and Uninstalling 9.3

postgresqlpostgresql-9.3postgresql-9.4

I have installed postgresql 9.4 and I removed postgresql 9.3 from my computer. Now when I try to run:

foo@bar:~$ psql

I get the error

psql: could not connect to server: No such file or directory
    Is the server running locally and accepting
    connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

Note:

foo@bar:~$ psql --version
psql (PostgreSQL) 9.4.2

Best Answer

I resolve the problem changin the port from 5433 to 5432