1. Want to check the master-slave library data are consistent, q, the database itself have any good way;
2. If not, how to write Java code to check,
CodePudding user response:
Since it is asynchronous, the data in the constantly changing, because there are differences between the time difference cause data is also more normal.If does not consider the effects of asynchronous, you can put the master/slave table read program line-by-line comparison (if there is a primary key, according to the primary key matching)
Line value, you can chase their fields in Java, can also be considered at the time of the query through the select the row (TB) : : text from TB this way for the combination, through the combination is the same to determine compliance with two tables
CodePudding user response:
Pg_stat_replicationOr oneself write a process, the main library to write a list, set up a time, after this time to prepare library view data consistent,
CodePudding user response:
Mainly for pg database not familiar with, this should be how to write?