I get the following error when trying to send queries to a Postgres server in hot standby:
BEGIN;
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE READ ONLY;
COMMIT;
And the error:
SQL Error [0A000]: ERROR: cannot use serializable mode in a hot standby
Hint: You can use REPEATABLE READ instead.
Error position:
My question is why is this limitation in place? Given that no query on the standby itself could cause an anomaly, it seems like REPEATABLE READ is equivalent to SERIALIZABLE. My best guess is that replication from the primary to the standby may cause partially executed transactions to be visible on the standby. However, after reading about Predicate Locks, it would seem that the standby could use these locks to prevent any anomalies from being visible to the clients.
Even after reading the docs, I don't understand how purely read only transactions could experience an anomaly.