I got three servers with postgresql, one is the main db, other two is replication of the main server. I got 5 sql files with droping and recreating materialized views on the main server. My question is how will cope those replication servers? Do i need to restart them to accept changes, or they automatically refresh its data? What commands should i use to solve my problems?
1 Answer
The standby servers are physical copies of the primary, so they will eventually contain the same data as the primary. There is no special action required.
The only consideration is that creating a materialized view can produce a lot of transaction log (WAL) if the materialized view is large, and this may cause replication to lag for a while if the network connection isn't fast.
2 Comments
ikari
can this be avoided? is this about the number of updates happening, or the cumulative size of them?
Laurenz Albe
@ikari Refreshing a materialized view is a single change - it is about the total size. But in practice, it shouldn't be a problem.