На этот вопрос уже есть ответ здесь:
Я выполнил инструкцию о том, как настроить Ubuntu 10.04 с PostgresSQL
$ psql
Или это:
lucid@ubuntu:~$ sudo -u postgres psql postgres
[sudo] password for lucid:
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"?
Кто-нибудь знает решение?
Я считаю, что команда должна быть
sudo -u postgres psql postgres
См. https://help.ubuntu.com/community/PostgreSQL
. Если это не работает, расскажите нам больше о вашей конфигурации.