[GENERAL] Why release index relation lock

2013-11-01 Thread DT
Hi, For some operations, such as INSERT/UPDATE, heap relation lock is held until xact commit, but index relation lock is released after command end. Some other operations also hold index relation lock until xact commit, such as VACUUM. I have read chapter 54. Index Access Method Interface Def

[GENERAL] Why there are TRANS_START and TRANS_INPROGRESS

2013-10-22 Thread DT
Hi, I'm reading code of xact.c, and I found the only difference between TRANS_START and TRANS_INPROGRESS is when transaction aborts in TRANS_START status we set status to TRANS_INPROGRESS so AbortTransaction() will not report WARNING. So I wonder to know the reason why we distinguish them?

[GENERAL] ALTER TABLE transaction isolation problem

2013-09-02 Thread DT
Hi, I'm reading code of ALTER TABLE, and I found when target table needs rewrite, tuple inserted into new heap uses current transaction's xid as xmin. Does this behavior satisfy serializable isolation? I wrote some test cases: CREATE TABLE t1(a INT);CREATE TABLE t2(a INT);INSERT INTO t1 VALUES

[GENERAL] What are ExecSeqMarkPos and ExecSeqRestrPos used for

2013-05-28 Thread DT
Hi, I'm reading code of nodeSeqscan, and was confused with ExecSeqMarkPos and ExecSeqRestrPos. They are only called by ExecMergeJoin. Could merge join use a plain seqscan as outer/inner plan? If not, what are they used for? Thanks.