Forums

psql command error from terminal

I just upgraded my account to include a Postgres DB, but when I log into ssh.pythonanywhere.com and type "psql" at the command prompt, I get this error:

09:21 ~ $ psql
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"?

A little help?

I can see that you've created a Postgres server from the "Databases" tab, so all you need to do is specify the address, port, and username on the command line. For example:

psql -h <host> -p <port> -U <username> -W <password> <database>

...replacing <host> and <port> with the values from the "Databases" tab, and the other <...> bits with the username, password and database you set up.

There's also a short-cut to start a psql console using the super user on the "Databases" tab.