February 2020
Intermediate to advanced
734 pages
38h 13m
English
We really want to confirm whether the streaming replication works as advertised. To do this, let's shut down the standby server with this command:
sudo systemctl stop postgresql-12
Then, try to write to the primary server. This simple SQL statement should wait indefinitely:
CREATE TABLE foo ( bar INT );
If we then restart the streaming replica using the following command, we should see the transaction complete:
sudo systemctl start postgresql-12
As you might imagine, this can be problematic in true high-availability architectures that handle thousands of transactions per second. As such, we don't actually recommend that you use synchronous replication on OLTP servers. As these comprise the bulk of highly available PostgreSQL ...
Read now
Unlock full access