You have servers with master-slave(s) replication and want to be sure what all tables is synced. Program queries count of records for every table in database and shows to you on screen. Used on servers with logical replication and wal-g.
Create config.yaml with connection strings:
credentials: master: postgres://username:email@example.com:5433/mydatabase?sslmode=disable slave_logical: postgres://username:firstname.lastname@example.org:5432/mydatabase?sslmode=disable slave_walg: postgres://username:email@example.com:5435/mydatabase?sslmode=disable
Sample output, table ga is out of sync on slave_walg:
2020/07/16 05:45:45 master successfully connected! 2020/07/16 05:45:46 slave_logical successfully connected! 2020/07/16 05:45:46 slave_walg successfully connected! 2020/07/16 05:45:46 Table name: ga 2020/07/16 05:46:07 Postgres name: master Count: 25381158 2020/07/16 05:45:51 Postgres name: slave_logical Count: 25381158 2020/07/16 05:46:06 Postgres name: slave_walg Count: 25342939 2020/07/16 05:46:07 ------------
Source code and install https://git.blindage.org/21h/compare-postgres-tables