postgresql system columns(二)

2014-11-24 13:33:05 · 作者: · 浏览: 1
gres=# begin;
BEGIN
postgres=# select txid_current();
txid_current
--------------
1726
(1 row)
postgres=# update t set i=20 where s=10000004;
UPDATE 1
postgres=# commit;
COMMIT
postgres=# select *,xmin,xmax from t where s=10000004 limit 10;
s | i | xmin | xmax
----------+----+------+------
10000004 | 20 | 1726 | 0
总结一下,也就是说不管回滚还是未提交,都会获取新的事务号,但是在update提交的情况下,xmax归零,xmin获取当前事务号。
cmax:删除事务内部的命令标识
txid:有了以上的例子,很好理解了,就是事务ID,这个可不是表的隐含列哦