1

I will create a django app on Debian 7 with postgreSQL 9.2. I created a droplet in digital ocean. I updated and upgraded the system. I used the following command

sudo aptitude install postgresql postgresql-contrib

to install postgresql.

When I changed user to postgres and I wanted to create a new db user with createuser -P

I filled all the fields it wanted but it came up with this error:

createuser: could not connect to database postgres: 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"?

I tried same process a few times with new droplets in Ubuntu 12.04 and Debian 7.

What should I do? I want to use Debian 7, so I prefer solutions with Debian. I am new at this stuff so be explanatory please. Thanks.

4
  • Have you tried to use initdb to create a postgres DB cluster ? Commented Jun 24, 2014 at 14:50
  • How should I do it? :) Commented Jun 24, 2014 at 15:24
  • Use postgres manual : postgresql.org/docs/current/static/app-initdb.html or just google postgres initdb Commented Jun 24, 2014 at 16:02
  • "Is the server running locally and accepting connections on Unix domain socket ..." <-- check this. Start with "ps -u postgres" to see if there's anything running. Commented Jun 24, 2014 at 23:34

1 Answer 1

3

I figured it out with fixing locale problem and reinstall PostgreSQL

First: http://perlgeek.de/en/article/set-up-a-clean-utf8-environment

Second: How to thoroughly purge and reinstall postgresql on ubuntu?

Set up the locale and make a clean installation for postgreSQL.

Thanks!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.