postgresql中的冻结

pg会进行常规的清理老的事务标识符活动,也是就是冻结,来延迟事务wrapround,在pg中一行有2个途径,行版本死亡需要被vacuum清除,或是一个行的版本足够老需要被冻结,

对一个数据库进行vacuum操作

psql -c "VACUUM" postgres

pg使用4字节长度来表示标识符,所以事务的个数是有限的,分配标识符是通过循环的方式进行的,当出啊先wrapround的时候,可能会报下面的错误

ERROR: database is not accepting commands to avoid wraparound data loss in database
"template0"
HINT: Stop the postmaster and use a standalone backend to vacuum that database


standalone backend的方式如下:

$ postgres --single -D /full/path/to/datadir postgres

backend> VACUUM;

执行完后,退出终端


Prepared transactions are part of the "two-phase commit" feature, also known as 2PC. A
transaction commits in two stages rather than one, allowing multiple databases to have
synchronized commits. It's typical use is to combine multiple "resource managers" using
the XA protocol, usually provided by a Transaction Manager (TM), as used by the Java
Transaction API (JTA) and others. If none of that meant anything to you, then you probably
don't have any prepared transactions.


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值