Postgres 9.2 Replication Configuration on CentOS 5(二)
ERT in a read-only transaction
testdb=> \q
[postgres@zwc ~]$ psql -h zwc -U zwc -d testdb
Password for user zwc:
psql (9.2.4)
Type "help" for help.
testdb=> insert into t02 values(1),(2);
INSERT 0 2
testdb=> \q
[postgres@zwc ~]$ psql -h pgstandby -U zwc -d testdb
Password for user zwc:
psql (9.2.4)
Type "help" for help.
testdb=> select * from t02;
id
----
1
2
(2 rows)
testdb=>
Standby database log
STATEMENT: insert into t02 values(1),(2);
LOG: connection received: host=192.168.1.13 port=27595
LOG: connection received: host=192.168.1.13 port=27596
LOG: connection authorized: user=zwc database=testdb
LOG: restartpoint starting: time
LOG: restartpoint complete: wrote 21 buffers (0.5%); 0 transaction log file(s) added, 0 removed, 0 recycled; write=2.019 s, sync=0.009 s, total=2.031 s; sync files=17, longest=0.005 s, average=0.000 s
LOG: recovery restart point at 0/7C015D50
DETAIL: last completed transaction was at log time 2013-09-03 22:03:22.099392+08
ERROR: cannot execute DELETE in a read-only transaction
STATEMENT: delete from t02 where id=1;