I am using PostgreSQL server and suddenly I am getting this error. Due to that, I am not able to insert data into any table.
org.postgresql.util.PSQLException: ERROR: cannot execute INSERT in a read-only transaction
I have checked solution online and found that the default_transaction_read_only parameter needs to be set to off but it is off already.
Log on to PostgreSQL and verify if your database is in recovery mode or not with below command :-
pg_is_in_recovery() should be false(f)
Further check if default transaction is read-only or read-write with below command :-
default_transaction_read_only must be "off"
If issue persists after performing the above fix, please check on the connection setting and make sure to use hostname rather than host IP in place of jdbcUrl
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With