Re: Summary and Plan for Hot Standby - Mailing list pgsql-hackers

From Tatsuo Ishii
Subject Re: Summary and Plan for Hot Standby
Date
Msg-id 20091117.092540.74752205.t-ishii@sraoss.co.jp
Whole thread Raw
In response to Re: Summary and Plan for Hot Standby  (Simon Riggs <simon@2ndQuadrant.com>)
Responses Re: Summary and Plan for Hot Standby
List pgsql-hackers
> > Please correct me if I'm wrong. Parse will result in obtaining
> > RowExclusiveLock on the target table if it is parsing
> > INSERT/UPDATE/DELETE. If so, is this ok in the standby?
> 
> Any attempt to take RowExclusiveLock will fail.
> 
> Any attempt to execute INSERT/UPDATE/DELETE will fail.
> 
> This behaviour should be identical to read only transaction mode. If it
> is not documented as an exception, please report as a bug.

Is it?

It seems read only transaction mode is perfectly happy with
RowExclusiveLock:

test=# begin;
BEGIN
test=# set transaction read only;
SET
test=# prepare a(int) as insert into t1 values($1);
PREPARE
test=# \x
Expanded display is on.
test=# select * from pg_locks;
-[ RECORD 1 ]------+-----------------
locktype           | relation
database           | 1297143
relation           | 10969
page               | 
tuple              | 
virtualxid         | 
transactionid      | 
classid            | 
objid              | 
objsubid           | 
virtualtransaction | 1/101699
pid                | 28020
mode               | AccessShareLock
granted            | t
-[ RECORD 2 ]------+-----------------
locktype           | virtualxid
database           | 
relation           | 
page               | 
tuple              | 
virtualxid         | 1/101699
transactionid      | 
classid            | 
objid              | 
objsubid           | 
virtualtransaction | 1/101699
pid                | 28020
mode               | ExclusiveLock
granted            | t
-[ RECORD 3 ]------+-----------------
locktype           | relation
database           | 1297143
relation           | 1574918
page               | 
tuple              | 
virtualxid         | 
transactionid      | 
classid            | 
objid              | 
objsubid           | 
virtualtransaction | 1/101699
pid                | 28020
mode               | RowExclusiveLock
granted            | t

test=# select relname from pg_class where oid = 1574918;
-[ RECORD 1 ]
relname | t1
--
Tatsuo Ishii
SRA OSS, Inc. Japan


pgsql-hackers by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: Re: next CommitFest
Next
From: Itagaki Takahiro
Date:
Subject: Re: UTF8 with BOM support in psql