• version: PostgreSQL 11.4

  • OS: Windows 10

This is an illustration of my question:

enter image description here

On 3 different machines there are one primary server per machine.

Is it possible to have one common server where replicas of these primary servers are?

When configuring a replica, I am instructed to delete the current database (the PGDATA directory), if there is one. Thus my question. If I already have a replica on that database, it is then deleted?

Do I have to have several installations of PG? Having them on their own VM's?

  • 2
    You would need to run three different Postgres instances (different ports, different data directories) on the server that hosts all the replicas – a_horse_with_no_name Oct 10 at 13:16

You understood correctly. Since streaming replication keeps the replica a physical copy of the primary database cluster, you can only replicate between one primary and one replica.

There are two options:

  1. Keep three clusters on the replica machine, one for each primary cluster.

  2. Use logical replication.

    With logical replication, you have to make sure that each subscription replicates to different tables, ideally in different databases.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.