Switch Your PostgreSQL Primary for a Read Replica Without Downtime

In my ongoing research to identify solutions and similarities between MySQL - PostgreSQL, I recently faced a simple issue. I needed to perform a slave shift from one IP to another, and I did not want to have to restart the slave that is serving the reads. In MySQL, I can repoint the replication online with the command Change Master TO, so I was looking for a similar solution in Postgres. In my case, I could also afford some stale reads, so a few seconds delay would have been okay, but I couldn't take down the server.

After brief research, I noticed that there is not a solution that allows you to do that without restarting the PostgreSQL server instance.