You are here

Reviewing Postgres Log File for Replication Entries

Subscribe to Syndicate
Replication is a feature of postgres and is automatically set up for cloud venues. Self service venues may set this up if they wish - the support team is unable to help you.
The data is replicating from the Main server to the hot standby periodically, as per the frequency that you set in the archive_timeout parameter. If there is a change to the main database, it should appear in the hot standby very shortly after that.

You should go to the log files once in a while and ensure that it is replicating and able to see/connect to the other database. After the tail command, you should see that the server entered standby mode and that is connecting to the main server.

Even after setting up the replication to the hot standby server, you should check this log periodically to make sure it continues to work.

su - postgres
Enter the Postgres password
cd /Library/PostgreSQL/9.6/data/pg_log
ls -la (to see a list of logs)
tail -f name-of-most-recent-log-file
The most recent log file will have today's date in it and the 'tail -f' command will continue to display the changes to the file as they occur.

The example below shows the startup of the standby server after first being created (or being stopped for a period of time). The log files are consumed and, finally, replication starts. Once replication starts, no further 'restore' messages will appear in the logs -- you can then use the pgAdmin query method to view the status of replication on the main server.