Xid:数据库的事件ID;
Xmin:行头部的xid信息,xmin示意插进去该纪录的事件ID
Xmax:示意删除或lock该纪录的事件ID
xid_snapshot:当前集群中为完毕的事件
Clog:事件提交状况日记
纪录花样的定义:htup_details.h:POSTGRES heap tuple header definitions.
1)检察一切xid相干的函数有哪些,这里须要的是txid_current函数
2)能够看到当前的事件ID
postgres=# select * from txid_current(); txid_current -------------- 1676 (1 row) 3)举行一次insert后,看事件ID已+1 postgres=# insert into tt values(1); INSERT 0 1 postgres=# select ctid,xmin,xmax,cmin,cmax,id from tt; ctid | xmin | xmax | cmin | cmax | id -------+------+------+------+------+---- (0,1) | 1677 | 0 | 0 | 0 | 1 (1 row)
4)开启一个事件后,举行update
postgres=# begin; BEGIN postgres=# update tt set id=3; UPDATE 1 postgres=# select ctid,xmin,xmax,cmin,cmax,id from tt; ctid | xmin | xmax | cmin | cmax | id -------+------+------+------+------+---- (0,2) | 1678 | 0 | 0 | 0 | 3 (1 row)
5)在别的一个会话检察
postgres=# select ctid,xmin,xmax,cmin,cmax,id from tt; ctid | xmin | xmax | cmin | cmax | id -------+------+------+------+------+---- (0,1) | 1677 | 1678 | 0 | 0 | 1 (1 row)
看当前未完毕的事件,或未开启的事件
postgres=# select *from txid_current_snapshot(); txid_current_snapshot ----------------------- 1684:1684: (1 row) postgres=# select * from txid_current(); txid_current -------------- 1684 (1 row)
纪录事件是不是提交,在这个文件内里,bit:
-rw-------. 1 pg pg 8192 Jun 10 04:19 0000 [pg@localhost pg_clog]$ pwd /home/pg/data/pg_clog
本文引见了PostgreSQL 版本辨认 ,更多相干内容请关注ki4网。
相干引荐:
解说B/S与C/S究竟是何物
怎样经由过程css3+html5完成纵向菜单
关于HTML5当地存储的相干解说
以上就是关于PostgreSQL 版本辨认 的详解的细致内容,更多请关注ki4网别的相干文章!