We really want to confirm if the streaming replication works as advertised. To do this, let's shut down the standby server with this command:
pg_ctl -D /db/pgdata stop -m fast
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:
pg_ctl -D /db/pgdata start
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 ...