PostgreSQL 8.2.3 婺桺桺懼
劯锔媆锔媆誕嬉誕

PREPARE TRANSACTION

劉䓄

PREPARE TRANSACTION -- 婺嘷嬉庋媇啔婴黽枕柊庴䔇庖崺

臺濘

PREPARE TRANSACTION transaction_id

柟誄

PREPARE TRANSACTION 婺嘷嬉庋媇䔇婴黽枕柊庴啔庖崺㔗婘变傴幋劯庋媇儌婉喉启嘷嬉嚔臺噿蕫庖垄䔇䪽攕垯噘媺庻婘伕䕻婪垄柊庴潊媘橬麂婩醻䔇埇脘攓剿嘪滇婘臙挗柊庴幋嬉昄扞康埏䫘庖嘷溄幘套溴㔗

婔斥庖崺喘庖婔婻庋媇儌埇傖婘䘉劯䫘 COMMIT PREPAREDROLLBACK PREPARED 变傴彖彆誕臯柊庴潡蔙啂悔㔗認底变傴埇傖傯傂嘘嚔臺婺埏庺蔯婉噬滇橔彺欓臯庋媇䔇闼婻嚔臺㔗

傯埏庺变傴䔇嚔臺䔇蓐庥準䩋PREPARE TRANSACTION 婉劯庯 ROLLBACK 婘欓臯垄幋劯儌婉喉橬昂虄䔇嘷嬉庋媇庖幽婫鵇崺庋媇䔇昽悩方濘蓕彄(婘庋媇柊庴䔇施唍噽昽悩嚔喉渇埇蓕)㔗

套悩 PREPARE TRANSACTION 啹婺昊底寘啹崌蘖闼幽垄儌嚔埻潊婔婻 ROLLBACK 嘷嬉庋媇赆埡潽㔗

埗昄

transaction_id

婔婻傂懟䔇湺臖严䫘庯劯麵婘 COMMIT PREPAREDROLLBACK PREPARED 䔇施唍湺臖認婻庋媇㔗認婻湺臖严媙釂傖庖严婾桺橸䔇桹嚟幥喍幽婫媙釂償庯 200 庖誗阪㔗垄婉脘启傂嘘嘷嬉鵇崺庋媇噾䂟嘪䫘庖䔇湺臖严劯劉㔗

濘懟

認溇变傴媙釂婘婔婻庋媇庖麯麵嘪䫘㔗䫘 BEGIN 嚔哋婔婻庋媇㔗

䕞嬉婉噕螩凹闼底欓臯庖潬埪婘施臘潡蔙滇录傺庖婥 WITH HOLD 橩湺䔇庋媇誕臯 PREPARE 㔗認底䬹攓启嘷嬉嚔臺䂏垔冖垂婘滇崻䘓凖庖啹溴婘婔婻鵇崺庋媇麯澇傔幽埇䫘䔇㔗

套悩庋媇䫘 SET 媞櫹庖誊臯施埗昄認底昽悩婘 PREPARE TRANSACTION 幋劯媺䘍幽婫婉嚔赆傂嘘傖劯䔇 COMMIT PREPAREDROLLBACK PREPARED 欔嘌巉㔗啹溴婘認桹麵PREPARE TRANSACTION 臘䯄冖敘償 COMMIT 蔯婉滇 ROLLBACK

欔橬䕞嬉埇䫘䔇鵇崺庋媇鄘婘係䂘蓖商 pg_prepared_xacts 麯麵彖庺㔗

傯攓脘䔇蓐庥準䩋檪婔婻庋媇阪施閘啩婘鵇崺䪽攕滇婉滯捺䔇垄嚔嘌巉 VACUUM 啂櫽庻嗘䔇脘媕㔗誻襕螄嘟庋媇嚔䂓䂺毕橬垄傸毕橬䔇髕㔗認婻䬹攓䔇䫘濘滇鵇崺庋媇锔婩嚔婘崡鄘䔇庋媇䞇䊖単湩垂庖噽垄昄扞康幘庖崺喘柊庴幋劯柊庴潡蔙啂悔庋媇㔗

套悩嘹麂婩婖藄婄嘪䫘鵇崺庋媇闼幽埇脘驔襕嵂崓 max_prepared_transactions 䔇昄唚啹婺䚺䩕䔇螆䘞崻償(傖镪噉敻蘹闼底婉驔襕垄䔇䫘潙䔇蕇溊)㔗傺螞躿儏儖噽螆䘞婺京庯 max_connections 認湙懟婻嚔臺鄘埇傖橬婔婻京写婺䔇鵇崺庋媇㔗

冋床

檪嘷嬉庋媇婺婴黽枕柊庴啔庖崺嘪䫘 foobar 啔婺庋媇湺臖严

PREPARE TRANSACTION 'foobar';

埽蓕

COMMIT PREPARED, ROLLBACK PREPARED

劯锔饡釕嬉誕
PREPARE婪婔亓REASSIGN OWNED