SET TRANSACTION transaction_mode [, ...] SET SESSION CHARACTERISTICS AS TRANSACTION transaction_mode [, ...] 認麯䔇 transaction_mode 滇婋彖幋婔 ISOLATION LEVEL { SERIALIZABLE | REPEATABLE READ | READ COMMITTED | READ UNCOMMITTED } READ WRITE | READ ONLY
SET TRANSACTION 变傴婺嘷嬉庋媇螆䘞䬹攓㔗垄凹劯麵䔇庋媇澇橬嘌巉㔗SET SESSION CHARACTERISTICS 婺婔婻嚔臺婺锟劯䔇懟婻庋媇螆䘞䚺䩕䔇锫䥂亓彆㔗認底䚺䩕埇傖赆 SET TRANSACTION 婺婔婻䋸䆋䔇庋媇襖䕡㔗
埇䫘䔇庋媇䬹攓滇庋媇锫䥂亓彆启庋媇螪閞昇嚟(臂/喍潡蔙埻臂)㔗
庋媇䔇锫䥂亓彆喿垔婔婻庋媇婘劯施庻婘噽垄幽埏誊臯䔇庋媇施垄脘崘䩋彄傔幽昄扞
婔溇臺埖埻脘䩋彄婘垄嚔哋幋嬉䔇昄扞㔗認滇䚺䩕㔗
嘷嬉庋媇婺䔇欔橬臺埖埻脘䩋彄婘認渇庋媇丸婔溇昖臵潡蔙媞櫹昄扞䔇臺埖欓臯幋嬉䔇昄扞㔗
SQL 湺庖誻垔幬庖埥崡婴婻亓彆READ UNCOMMITTED 启 REPEATABLE READ 㔗婘 PostgreSQL 麯 READ UNCOMMITTED 赆嘷嘩 READ COMMITTED REPEATABLE READ 赆嘷嘩 SERIALIZABLE
庋媇锫䥂亓彆婘庋媇婺丸婔婻昄扞媞櫹臺埖(SELECT, INSERT, DELETE, UPDATE, FETCH, COPY)欓臯幋劯儌婉脘喉渇螆䘞㔗埗黙䆹12诙埡橬噿庋媇锫䥂亓彆启幽埏攓毓彽䔇敘崔媇敇㔗
庋媇螪閞昇嚟喿垔庋媇滇臂/喍誻滇埻臂㔗臂/喍滇䚺䩕㔗套悩婔婻庋媇滇埻臂蔯婫喍噖䔇臘婉滇婘施臘闼幽婋麵䔇 SQL 变傴滇婉噕螩䔇INSERT, UPDATE, DELETE, COPY FROM 蔯欔橬䔇 CREATE, ALTER, DROP, COMMENT, GRANT, REVOKE, TRUNCATE, EXPLAIN ANALYZE, EXECUTE 鄘婉噕螩㔗認滇婔婻醻北渇䔇埻臂楗媕垄幽婉黂溵欔橬凹伕䕻䔇喍噖㔗
套悩欓臯 SET TRANSACTION 幋嬉澇橬欓臯 START TRANSACTION 潡 BEGIN 闼幽垄嚔滆冖澇橬昽悩婔湙啹婺庋媇儖䆋剿䂷溘㔗
埇傖䫘婘 BEGIN 潡 START TRANSACTION 麯麵弄滯欔驔襕䔇 transaction_modes 䔇桹濘準镪噉嘪䫘 SET TRANSACTION 㔗
嚔臺䔇䚺䩕庋媇锫䥂亓彆幘埇傖锔誺螆䘞陉䘞埗昄 default_transaction_isolation 启 default_transaction_read_only 䔇桹濘準螆䘞(垂鍙婪 SET SESSION CHARACTERISTICS 埻滇婔婻䫘 SET 準螆䘞認底埗昄䔇喖阪京昽䬷)㔗認儌懟叿五䚺䩕唚埇傖锔誺 ALTER DATABASE 潡婘陉䘞桺傽麯京桹濘螆䘞㔗埗蔄䆹17诙埡敘崔媇敇㔗
婴婻变傴鄘婘 SQL 湺庖麯垔幬庖㔗SQL 麯䔇䚺䩕庋媇锫䥂亓彆滇 SERIALIZABLE 嘖婘 PostgreSQL 麯䚺䩕锫䥂亓彆滇 READ COMMITTED 嘖滇嘹埇傖䫘婪麵柟誄䔇桹濘媞櫹垄㔗啹婺䚺儏脷臉髕垔 SERIALIZABLE 亓彆幽麂䩘溼䔇埇婾臯寡㔗埗黙䆹12诙埡䂖誗㔗
婘 SQL 湺庖麯誻橬埥崡婔䓉庋媇䬹攓埇傖䫘認底变傴螆䘞自桺评啘䔇崓償㔗認婻楗媕埻䫘庯啯噖嚟 SQL 啹溴澇橬婘 PostgreSQL 橉媇単麯垂䯄㔗
SQL 湺庖襕挗婘䕩誂䔇 transaction_modes 幋閘嘪䫘锖埙嘖滇啹婺寖埾寘啹PostgreSQL 噕螩䩕䘖認婻锖埙㔗