PostgreSQL pg_basebackup from several port number

postgresqlreplication

I have one slave server which used as a replication server (let's called it slave1) from several master servers.

The `slave1' server is set up to receive replication from several postgresql server, and I set it at multiple ports. The settings is like this:

Master1 port 5432 replicated to slave1 port 5432
Master2 port 5432 replicated to slave1 port 5433
etc.

Those server above (master1, master2, & slave1) are hosted at cloud.

all server using Postgresql-11 on Ubuntu 18.04.1 LTS

Is it possible to replicate my slave1 to my on premise server at office (called slave2), so that all databases on slave1 on all port is replicated to my slave2 on single port (port 5432 which is the default port of postgresql) ??

Best Answer

Using physical replication, no, that isn't possible. You would have to use the new-ish logical replication feature to consolidate the data from multiple clusters to one cluster.