I have set up streaming replication from a master DB to a slave DB. If the master is shut down, the slave will take over. The replication and failover works fine.
I have a web app using the master database for storing data.
Some details:
I want to continue using this method of doing replication.
The questions:
I suggest having a look at pgpool with the failover_command option. There you can have a small shell script to restart the slave in read/write mode. pgpool
In case you run into some issues with pgpool, this process which I followed to troubleshoot might help - pgpool - stracing