As a contrast, I really like Riak's ability to just work with one node down...
As a contrast, I really like Riak's ability to just work with one node down...
But yeah - if you need automatic failover and master election, you still need third-party tools. Some have had success with pgPool as a out-of-the-box solution (I haven't. I had severe reliability issues with pgPool. You might be more lucky), others produce their own scripts.
The process isn't complicated, it just requires you reading a lot of manpages and thinking ahead, but once you got the process down, postgres itself is reliable enough that its (admittedly limited) tools just work (which is a very good thing).
As long as Postgres doesn't do master-master replication, failover will always be a complicated topic to deal with.
They do support automatic failover too. The docs are in the Github repo somewhere.
One feature which would be really nice to have is the ability to do a manual switchover, ie making the existing master into a replica and an existing replica into the new master.
Another poster mentioned repmgr which looks good but hasn't had a release in sometime ( https://github.com/2ndQuadrant/repmgr/blob/master/HISTORY ) with 2 new Postgres releases since, although there does seem some sporadic work on a new beta.
Now you change R1 to master, and take M1 "offline", afterwards turn M1 back on, and have it become a slave to R1.
See http://wiki.postgresql.org/wiki/What's_new_in_PostgreSQL_9.3...