Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Postgresql db materialised view refreshing on replication

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?

like image 234
Julius Grybinas Avatar asked Apr 21 '26 09:04

Julius Grybinas


1 Answers

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.

like image 80
Laurenz Albe Avatar answered Apr 23 '26 01:04

Laurenz Albe