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 am looking at replication of the master database (PostgreSQL) and this is the configuration I have to setup

master -- hot-standby (hs)
 --- read only slave (r1)
 --- read only slave (r2)

My requirement is that the either of master or standby should be available all the time and r1-r2 should be available most of the time.

I have setup streaming replication with recovery on hs and without recovery on r1,r2. All these 3 get the WAL logs from master.

My question is, when the master goes down and we trigger the failover on standby, what should I do to r1 and r2 ? re-parenting them to standby would mean a full base-backup and when eventually master comes up, i may need to re-parent again.

This is my first attempt at replication-setup. So if there is anything obvious I am missing or doing wrong, please let me know. If there are tools/solutions which cater to this sort of a thing, I would be very glad to know and learn.

share|improve this question

There are some tricks to make r1/r2 follow new parent, but generally I see them as tricks, which means I wouldn't really depend on them in production environment.

You might want to check this blogpost:

share|improve this answer
Thanks a lot!! I will go over it. – user1667 May 4 '11 at 10:23

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.