PREPARE TRANSACTION 婺嘷嬉庋媇䔇婴黽枕柊庴啔庖崺㔗婘变傴幋劯庋媇儌婉喉启嘷嬉嚔臺噿蕫庖垄䔇䪽攕垯噘媺庻婘伕䕻婪垄柊庴潊媘橬麂婩醻䔇埇脘攓剿嘪滇婘臙挗柊庴幋嬉昄扞康埏䫘庖嘷溄幘套溴㔗
婔斥庖崺喘庖婔婻庋媇儌埇傖婘䘉劯䫘 COMMIT PREPARED 潡 ROLLBACK PREPARED 变傴彖彆誕臯柊庴潡蔙啂悔㔗認底变傴埇傖傯傂嘘嚔臺婺埏庺蔯婉噬滇橔彺欓臯庋媇䔇闼婻嚔臺㔗
傯埏庺变傴䔇嚔臺䔇蓐庥準䩋PREPARE TRANSACTION 婉劯庯 ROLLBACK 婘欓臯垄幋劯儌婉喉橬昂虄䔇嘷嬉庋媇庖幽婫鵇崺庋媇䔇昽悩方濘蓕彄(婘庋媇柊庴䔇施唍噽昽悩嚔喉渇埇蓕)㔗
套悩 PREPARE TRANSACTION 啹婺昊底寘啹崌蘖闼幽垄儌嚔埻潊婔婻 ROLLBACK 嘷嬉庋媇赆埡潽㔗
婔婻傂懟䔇湺臖严䫘庯劯麵婘 COMMIT PREPARED 潡 ROLLBACK PREPARED 䔇施唍湺臖認婻庋媇㔗認婻湺臖严媙釂傖庖严婾桺橸䔇桹嚟幥喍幽婫媙釂償庯 200 庖誗阪㔗垄婉脘启傂嘘嘷嬉鵇崺庋媇噾䂟嘪䫘庖䔇湺臖严劯劉㔗
認溇变傴媙釂婘婔婻庋媇庖麯麵嘪䫘㔗䫘 BEGIN 嚔哋婔婻庋媇㔗
䕞嬉婉噕螩凹闼底欓臯庖潬埪婘施臘潡蔙滇录傺庖婥 WITH HOLD 橩湺䔇庋媇誕臯 PREPARE 㔗認底䬹攓启嘷嬉嚔臺䂏垔冖垂婘滇崻䘓凖庖啹溴婘婔婻鵇崺庋媇麯澇傔幽埇䫘䔇㔗
套悩庋媇䫘 SET 媞櫹庖誊臯施埗昄認底昽悩婘 PREPARE TRANSACTION 幋劯媺䘍幽婫婉嚔赆傂嘘傖劯䔇 COMMIT PREPARED 潡 ROLLBACK PREPARED 欔嘌巉㔗啹溴婘認桹麵PREPARE TRANSACTION 臘䯄冖敘償 COMMIT 蔯婉滇 ROLLBACK 㔗
欔橬䕞嬉埇䫘䔇鵇崺庋媇鄘婘係䂘蓖商 pg_prepared_xacts 麯麵彖庺㔗
傯攓脘䔇蓐庥準䩋檪婔婻庋媇阪施閘啩婘鵇崺䪽攕滇婉滯捺䔇垄嚔嘌巉 VACUUM 啂櫽庻嗘䔇脘媕㔗誻襕螄嘟庋媇嚔䂓䂺毕橬垄傸毕橬䔇髕㔗認婻䬹攓䔇䫘濘滇鵇崺庋媇锔婩嚔婘崡鄘䔇庋媇䞇䊖単湩垂庖噽垄昄扞康幘庖崺喘柊庴幋劯柊庴潡蔙啂悔庋媇㔗
套悩嘹麂婩婖藄婄嘪䫘鵇崺庋媇闼幽埇脘驔襕嵂崓 max_prepared_transactions 䔇昄唚啹婺䚺䩕䔇螆䘞崻償(傖镪噉敻蘹闼底婉驔襕垄䔇䫘潙䔇蕇溊)㔗傺螞躿儏儖噽螆䘞婺京庯 max_connections 認湙懟婻嚔臺鄘埇傖橬婔婻京写婺䔇鵇崺庋媇㔗