skip to Main Content

Based on the descriptions it seems that for the Read Replicas for Postgresql, the Write-Ahead Log Shipping is used.
Is it logical? I have tables without primary keys, however when I spin up a read replica I have no problems so wonder what is being used behind the scenes.

2

Answers


  1. SELECT * FROM pg_replication_slots;
    

    will show you the type of replication.

    Login or Signup to reply.
  2. Cloud SQL "native" Postgres replicas (e.g., those you create via Cloud Console/gcloud/API) uses Postgres’ built-in streaming physical replication which involves WAL segment shipping from primary to replica(s).

    The needing primary keys is a constraint that exists in logical replication using an extension like pg_logical. You can configure your own replication relationships using pg_logical (as well as postgres’ own built in logical decoding on versions that support it) in Cloud SQL but this isn’t the same as native replication offering which is fully managed by Google.

    But to answer your question directly: Cloud SQL’s native read replicas, like the one you referred, uses WAL shipping (physical/streaming replication) as you suspect. Which is why your tables replicate just fine without primary keys.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search