Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot set transaction read-write mode during recovery error

Tags:

postgresql

I try to insert row:

BEGIN;
  SET TRANSACTION READ WRITE; 
INSERT INTO soft.lk(time_added, expiration_date)
    VALUES (now(), now() + INTERVAL '730 days');
COMMIT;

But have following error:

cannot set transaction read-write mode during recovery

What is recovery. And how can i insert row? Postgres version: 9.0

like image 734
Suhan Avatar asked Jun 24 '14 10:06

Suhan


1 Answers

You have connected to a read-replica server in hot standby mode - a streaming replica, or one that's using WAL archiving, it doesn't matter.

These servers are read-only. So you cannot write to them.

Connect to the master server instead.

like image 134
Craig Ringer Avatar answered Sep 18 '22 17:09

Craig Ringer