Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

This question already has an answer here:

I followed an instruction on how to setup Ubuntu 10.04 with PostgresSQL

$ psql

Or this:

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"?

Anyone knows a solution?

share|improve this question

marked as duplicate by bodhi.zazen, Radu Rădeanu, Thomas W., Basharat Sialvi, Mitch Jun 15 '13 at 14:51

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Take a look at postgres documentation at postgresql.org/docs/9.2/static/runtime-config.html In particular, sections 18.3.1 and 18.3.2 –  hmayag Jun 14 '13 at 22:23

1 Answer 1

up vote 0 down vote accepted

I believe the command should be

sudo -u postgres psql postgres

See https://help.ubuntu.com/community/PostgreSQL

If that does not work, tell us more about your configuration.

share|improve this answer
When I type this command, I get this "/var/run/postgresql/.s.PGSQL.5432"? -- same as the error in my question –  xybrek Jun 14 '13 at 21:07
See askubuntu.com/questions/42013/… –  bodhi.zazen Jun 14 '13 at 22:16

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