Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I ran sudo apt-get install postgresql on ubuntu 12.04. I didnt get a postgresql.config, instead I got a postgresql.config.sample and pg_hba.conf.sample. I renamed these (they installed in usr/share/postgresql) and uncommented listen address to localhost and the port to 5432. But still it doesnt seem to start? I get could not connect to server: Connection refused Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5432? in my webapp log (no log from postgresql). I have no clue what Im doing could someone please help me? I followed all the tutorials I found on the internet (I re-installed my server 3 times). But I cant get it to work.


share|improve this question

migrated from Aug 9 '13 at 20:09

This question came from our site for professional and enthusiast programmers.

When I install Postgres using debs I've got all the config files in /etc/postgresql/9.2/main/. Maybe try changing those files?

Btw, I'm almost sure that you need to restart postgres before those changes will be used.

share|improve this answer
solved it. Had to run a command after installing postgresql before the /etc/postgresql/9.2/main/ was created...pg_cluster..something – user2076941 Aug 9 '13 at 19:19

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.