This would act like a Postgres replica server to consume the logical changes in server. This is for sharing in Orcas.
This prject uses cmake to compile. To minimize the effort we need to spend during the configuration, I have decided not to include the require part. Instead, we only need
- download pre-compiled Postgres server files.
- download pre-compiled openssl files. and then modify the path.
Then,
mkdir bld
cd bld
cmake ..
cmake --build .
would compile the progrem
.\Debug\replication_checker.exe user username replication database host host.postgres.database.azure.com dbname test1 password LongPassword
Then, the application will connect to database server and receving the changes. When data chnages happen in database server, the changes will be displayed by this application.
For exmaple, for the partioned table "tb", if we insert into some values, replication_checker will display the logical part for this table:
And we could see the lag from the database side (becasue we do not replay the wal files, the replay lag would just increase):

In Postgres server, replica would connect to database server just like normal connections expcet add "replication=database" in connection string. In replication_checker, the input parameters would be pasred as "user=username replication=database host=host.postgres.database.azure.com dbname=test1 password=LongPassword".
Then, replication_checker will connect to database use the parsed connection string and looking for publication "pub" and create a subscription "sub". (this is currently hard coded, perhaps I will change in the feature)
Then, primary server will send data changes to replication_checker.
This programs supports logical replication protocols like "insert/update/delete" both in normal logical replication mode or streaming mode. For example
Then, in replication_checker we could have:
docker run -e PubName=pub -e SlotName=sub -it dog830228/replica-pg:0.5 user postgres replication database host localhost dbname postgres password test.123



