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

BEGIN

劉䓄

BEGIN -- 嚔哋婔婻庋媇庖

臺濘

BEGIN [ WORK | TRANSACTION ] [ transaction_mode [, ...] ]

認麯䔇 transaction_mode 滇婋彖幋婔

    ISOLATION LEVEL { SERIALIZABLE | REPEATABLE READ | READ COMMITTED | READ UNCOMMITTED }
    READ WRITE | READ ONLY

柟誄

BEGIN 彺哋寡婔婻庋媇庖幘儌滇臘欔橬 BEGIN 变傴劯䔇䫘潙臺埖鄘儖婘婔婻庋媇麯麵欓臯䕘彄䂍庺婔婻滯䇞䔇 COMMITROLLBACK 㔗䚺䩕施(澇橬 BEGIN)PostgreSQL 傖"autocommit"昇嚟欓臯庋媇幘儌滇臘懟婻臺埖婘噽躻躆䔇庋媇婺欓臯幽婫婘臺埖䂷溘䔇施唍套悩欓臯潊媘彍锊劆婄欓臯婔婻柊庴劥彍欓臯啂悔㔗

婘庋媇庖麯欓臯䔇臺埖冽滯滆婄媆冖崔啹婺庋媇嚔哋/柊庴驔襕崓麟䔇 CPU 启伕䕻昂媘㔗婘婔婻庋媇喙鄘欓臯崔溇臺埖凹庯媞櫹苖幾婻䕩噿䔇臘䔇施唍幘滇冽橬䫘䔇婘欔橬䕩噿䔇敘桄垯潊幋嬉噽垄嚔臺䩋婉彄婺閘䔇䪽攕㔗

套悩弄滯庖锫䥂亓彆潡蔙臂/喍昇嚟闼幽桄庋媇儖噙橬闼底䬹冕㔗儌償欓臯庖 SET TRANSACTION 婔湙㔗

埗昄

WORK
TRANSACTION

埇锬噿髞庖澇傔幽嘩䫘㔗

埗蔄 SET TRANSACTION 诙埡認婻臺埖䔇噽垄埗昄䔇劆幬㔗

濘懟

START TRANSACTION 橬五启 BEGIN 婔湙䔇媘脘㔗

嘪䫘 COMMITROLLBACK 䂷溘婔婻庋媇庖㔗

婘婔婻䯄橬庋媇庖喙鄘埏庺婔婻 BEGIN 儖库䫘婔婻躥只媇敇㔗庋媇䔇䪽攕儖婉嚔赆嘌巉㔗襕愿婘婔婻庋媇庖麯啯喖庋媇臙嘪䫘媺庻䗹(埗蓕 SAVEPOINT)㔗

庺庯劏婋噚垹蔄荏婘锟劯䔇 transaction_modes 幋閘䔇锖埙埇傖媘䘖㔗

冋床

嚔哋婔婻庋媇庖

BEGIN;

噚垹攓

BEGIN 滇 PostgreSQL 臺蘔䔇欷匘㔗京備庯 SQL 湺庖婺䔇 START TRANSACTION 变傴埇傖埗蔄鍇媹䔇噚垹攓媇敇㔗

釺冪臘婔埖BEGIN 噿髞庖婘啯噖 SQL 麯䫘庯婉劯䕞䔇㔗傺螞嘹婘䓂洉昄扞康庫䫘施傫䂖演昖庋媇䔇臺懟㔗

埽蓕

COMMIT, ROLLBACK, START TRANSACTION, SAVEPOINT

劯锔饡釕嬉誕
ANALYZE婪婔亓CHECKPOINT