0

I was set up two VMs where are the first VM is master PostgreSQL and the second is the slave. I use PostgreSQL 10 with logical replicating, so I created publisher and subscription.

Initially, I created necessary tables on Master, then take backup and apply it to the slave, so all tables are synced and all working good.

I am using Rails app with migrations, so, now I want to apply the migration to master DB which will create a lot of new tables.

What is the best way to create the same tables with indexes to replication?

A simple solution for me - create a master DB dump again and apply it to slave.

But, maybe there are exists other solutions to keep database structure synced?

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

1 Answers1

0

You can use Continuous Archiving to push any changes that happen to the master to the slave .

https://www.postgresql.org/docs/12/continuous-archiving.html

VynlJunkie
  • 1,953
  • 22
  • 26