Take the 2-minute tour ×

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

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



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

1 Answer 1

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
