Take the 2-minute tour ×
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. It's 100% free, no registration required.

I have set up a hot standby in PostgreSQL 9.0 on Windows.

I want that, at the time of fail-over, the slave should take over the role of master and start performing operations (both read and write) automatically.

How can I do that?

share|improve this question
    
These are some prior and somewhat related questions from the same user: dba.stackexchange.com/q/27868/7788 and dba.stackexchange.com/q/27121/7788 . Answers to the 2nd have a fair bit of detail, so that'll save some repetition. –  Craig Ringer Nov 1 '12 at 8:41
add comment

closed as off-topic by dezso, Kin, Mark Storey-Smith, bluefeet, Mat Sep 28 '13 at 15:26

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Too localized - this could be because your code has a typo, basic error, or is not relevant to most of our audience. Consider revising your question so that it appeals to a broader audience. As it stands, the question is unlikely to help other users (regarding typo questions, see this meta question for background)." – dezso, Kin, Mark Storey-Smith, bluefeet, Mat
If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer

I would start looking at repmgr from 2ndQuadrant. It is an open source replication management framework for PostgreSQL and takes care of things like failovers.

Otherwise you need to make sure the other node is dead (shoot the other node in the head), then remove the recovery.conf and restart. Note that at this point you will have irrevocably failed over and you cannot fail back until you set up the former master as a slave to the new master and then fail over again.

share|improve this answer
add comment

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