I am using PostgreSQL 8.4 on Ubuntu LTS 10.04.02 server version. I use pg_standby to restore the data and for database recovery created a recovery.conf and placed it on /etc/postgresql/8.4/main where rest of conf files present and tried to start the DB using

sudo service postgresql start

expecting the service to recognize that I am doing a recovery using recovery.conf. I found this file was ignored. Then, I had to copy all *.conf file to my data directory (in my case /dbdata/data) and then, instead of using script from init.d, I had to start the database from 'postgres' user with

/usr/lib/postgresql/8.4/bin/pg_ctl -D /dbdata/proddata  -l /var/log/postgresql/postgresql-8.4-main.log start

How I can make my recovery procedure to obey /etc/init.d/postgresql start|stop|restart or to have pg_ctl command to look for conf files /etc/postgresql/8.4/main ?

Note : I am relatively newbie to PostgreSQL and to database administration in general

1 Answer 1


The recovery.conf file needs to go into the data directory (/var/lib/postgresql/...). The other configuration files can stay where they are (/etc/postgresql/...). Then a normal restart should do what you want.

  • I am yet to validate it. but accepting the answer as it looks correct and I will be taking few days to validate them. Thanks Peter.
    – Jamess
    Commented Jun 22, 2011 at 8:30
  • It does not seem to look at /etc/postgresql/..., I had to keep postgresql.conf also in data directory. Probably this is specific to Ubuntu.
    – Jamess
    Commented Aug 9, 2011 at 5:13

Your Answer

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

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