SQL-Mac

Postgres Failovers

24th May 2018
databases
postgres
Last updated:13th November 2024
2 Minutes
301 Words

Navigating Postgres Failovers: A Casual Office Chat

So, this week threw me a curveball—a request to troubleshoot a failed failover on a Postgres cluster. Fun, right? Especially since Postgres is a whole new world to me. Well, why not embrace the challenge and grow my’ skill set? With the dev giving me a username and password, I dived headfirst into unraveling the failover mystery.

The Journey Begins

First hurdle: a classic case of mixed signals. Armed with the login credentials, I fired up PgAdmin, thinking I was all set as a Postgres user. Spoiler alert: I was dead wrong. Turns out, the username and password combo was for a Linux account with zero sudo powers. A merry-go-round of confusion later, I finally got my hands on the right keys.

Next up, I created own user in Postgres and tweaked some conf files to get myself into the system via PgAdmin on my laptop. Hours of Google-fu and access tug-of-wars later, I was in. Navigating the Postgres landscape wasn’t rocket science, thankfully. It’s kind of like RDBMS déjà vu, just with a new twist.

The Failover Tango

Now, brace yourself for the plot twist. In SQL land, failover magic with Availability Groups lets you juggle nodes with flair. Want a new primary replica? Use the wizard, dbatools, or run some SQL. But, here’s where Postgres throws a curveball.

In Postgres’s world, shifting the failover spotlight involves a more manual process. You say goodbye to the primary node, crown the standby server as the master (via manual intervention or a mystical trigger file…still deciphering that bit). And when the active node resurfaces, it gets a new gig as a standby server. Sounds like a chore, right? I’m still wrapping my head around this failover process. Maybe there’s a secret Postgres failover handshake I’m yet to uncover.

Still on the learning curve…

Article title:Postgres Failovers
Article author:sqlmac
Release time:24th May 2018