If you’re running a PostgreSQL database on Cloud SQL and need a replica for backup or scale-out purposes, you can set up replication to a replica VM using pglogical. In this blog post, we’ll guide you through the necessary steps to set up replication between Cloud SQL with PostgreSQL 14 as your primary and a replica VM running Red Hat Enterprise Linux 7. First, let’s start with the primary (Cloud SQL) side.