Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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 am running PostgreSQL (v 8.4) on Ubuntu 10.0.4.

The PG service currently starts on reboot (after I installed PG on my machine), however, I want the service to use a new data directory.

Currently, after a reboot, I have to:

  1. Stop the currently running PG service
  2. manually type: /usr/local/pgsql/bin/pg_ctl start -D /my/preffered/data/directory -l /usr/local/pgsql/data/logfile

Which file do I need to edit to ensure that I always have the service using the correct data folder?

share|improve this question

You should edit the file postgresql.conf. Where to find this file and a lot of other information can be found in postgresql's manual (18.1 and 18.2).

On my system (natty) this file is in /etc/postgresql/8.4/main. The variable you have to change is data_directory.

share|improve this answer

Your Answer


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

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