Since moving from 9.5 to 12 we are seeing alot of errors in the database log. The query that is being run is a basic update statement which changes the date of when a user is logged in.
2021-03-03 09:23:43.235 CET [18820] ERROR: cannot execute UPDATE in a read-only transaction
We did not see these errors when we were on an older version of postgres.
I have checked the default_transaction_read_only and thats set to off which is correct.
Why would I be seeing this now?
Please verify that you are not in a read-only transaction:
If the first is
off
and the second ison
, you must have explicitly started a read-only transaction withIf you are not inside a read-only transaction, the only explanation is that the database is in recovery mode.
Perhaps you connected to a streaming replication standby server.
To verify, see if the following returns “true”: