0

I have two DB instances with postgresql 10. First instance working with wal_level = logical, have ALL TABLE publisher. Second - have subscription to the publisher, described above.

All data from the Master DB tables are successfully sending to the replica. There is only one issue for me - when my App add a new table on Master - I need to add the same table to the replica (and run REFRESH PUBLICATION).

My question - is there a way for replica DB to create new tables automatically?

prosto.vint
  • 1,403
  • 2
  • 17
  • 30

1 Answers1

0

Schema changes aren't replicated. You can see that in the documentation, at Postgresql 10 Logical Replication: Subscription

The way I handle this is to make all schema changes through a script, and to write the script so that it executes the change commands twice: once on the primary database, and once on the replica.

Adina
  • 78
  • 6