成人免费xxxxx在线视频软件_久久精品久久久_亚洲国产精品久久久_天天色天天色_亚洲人成一区_欧美一级欧美三级在线观看

SET TRANSACTION 中文man頁面

系統(tǒng)
SET TRANSACTION 命令為當前事務設置特性。 它對后面的事務沒有影響。 SET SESSION CHARACTERISTICS 為一個會話中的每個事務設置缺省的隔離級別。 SET TRANSACTION 可以為一個獨立的事務覆蓋上面的設置。

NAME

SET TRANSACTION - 設置當前事務的特性

SYNOPSIS

SET TRANSACTION
    [ ISOLATION LEVEL { READ COMMITTED | SERIALIZABLE } ] [ READ WRITE | READ ONLY ]
SET SESSION CHARACTERISTICS AS TRANSACTION
    [ ISOLATION LEVEL { READ COMMITTED | SERIALIZABLE } ] [ READ WRITE | READ ONLY ]

DESCRIPTION 描述

SET TRANSACTION 命令為當前事務設置特性。 它對后面的事務沒有影響。 SET SESSION CHARACTERISTICS 為一個會話中的每個事務設置缺省的隔離級別。 SET TRANSACTION 可以為一個獨立的事務覆蓋上面的設置。


 可用的事務特性是事務隔離級別和事務訪問模式(讀/寫或者只讀)。


 事務的隔離級別決定一個事務在同時存在其它并行運行的事務時它能夠看到什么數(shù)據(jù)。

READ COMMITTED

 一條語句只能看到在它開始之前的數(shù)據(jù)。這是缺省。
SERIALIZABLE

 當前的事務只能看到在這次事務第一條查詢或者修改數(shù)據(jù)的語句執(zhí)行之前的數(shù)據(jù)。
Tip: 提示: 說白了,serializable(可串行化)意味著兩個事務將把數(shù)據(jù)庫保持在同一個狀態(tài), 就好象這兩個事務是嚴格地按照先后順序執(zhí)行地那樣。


 事務隔離級別在事務中第一個數(shù)據(jù)修改語句 (SELECT, INSERT, DELETE, UPDATE, FETCH, COPY) 執(zhí)行之后就不能再次設置。 參閱 Chapter 12 ``Concurrency Control'' 獲取有關事務隔離級別和并發(fā)性控制的更多信息。


 事務訪問模式?jīng)Q定事務是讀/寫還是只讀。讀/寫是缺省。如果一個 事務是只讀,而且寫入的表不是臨時表,那么下面的 SQL 命令是不允許的:INSERT, UPDATE,DELETE,和 COPY TO; 而所有的 CREATE,ALTER,和 DROP 命令; COMMENT,GRANT,REVOKE, TRUNCATE;和 EXPLAIN ANALYZE 和EXECUTE 都不允許。這是一個高層次的只讀概念,它并不阻止對磁盤的寫入。  

NOTES 注意


 會話的缺省事務隔離級別也可以用命令

SET default_transaction_isolation = 'value'


 以及在配置文件里設置。 參考 Section 16.4 ``Run-time Configuration'' 獲取更多信息。  

COMPATIBILITY 兼容性


 兩個命令都在 SQL 標準里定義了。SQL 里的缺省事務隔離級別是 SERIALIZABLE; 在 PostgreSQL 里,缺省隔離級別是 READ COMMITED,但是你可以用上面的描述修改它。 PostgreSQL 并沒有提供隔離級別 READ UNCOMMITTED 和 REPEATABLE READ。 因為多版本并發(fā)控制,SERIALIZABLE 級別并非真正的可串行化。參閱 Chapter 12 ``Concurrency Control'' 獲取細節(jié)。


 在 SQL 標準里還有另外一種事務特性可以用這些命令設置:診斷范圍的大小。這個概念只用于嵌入的 SQL。

#p#

NAME

SET TRANSACTION - set the characteristics of the current transaction

SYNOPSIS

SET TRANSACTION
    [ ISOLATION LEVEL { READ COMMITTED | SERIALIZABLE } ] [ READ WRITE | READ ONLY ]
SET SESSION CHARACTERISTICS AS TRANSACTION
    [ ISOLATION LEVEL { READ COMMITTED | SERIALIZABLE } ] [ READ WRITE | READ ONLY ]

DESCRIPTION

The SET TRANSACTION command sets the transaction characteristics of the current transaction. It has no effect on any subsequent transactions. SET SESSION CHARACTERISTICS sets the default transaction characteristics for each transaction of a session. SET TRANSACTION can override it for an individual transaction.

The available transaction characteristics are the transaction isolation level and the transaction access mode (read/write or read-only).

The isolation level of a transaction determines what data the transaction can see when other transactions are running concurrently.

READ COMMITTED
A statement can only see rows committed before it began. This is the default.
SERIALIZABLE
The current transaction can only see rows committed before first query or data-modification statement was executed in this transaction.
Tip: Intuitively, serializable means that two concurrent transactions will leave the database in the same state as if the two has been executed strictly after one another in either order.

The transaction isolation level cannot be set after the first query or data-modification statement (SELECT, INSERT, DELETE, UPDATE, FETCH, COPY) of a transaction has been executed. See the chapter called ``Concurrency Control'' in the documentation for more information about transaction isolation and concurrency control.

The transaction access mode determines whether the transaction is read/write or read-only. Read/write is the default. When a transaction is read-only, the following SQL commands are disallowed: INSERT, UPDATE, DELETE, and COPY TO if the table they would write to is not a temporary table; all CREATE, ALTER, and DROP commands; COMMENT, GRANT, REVOKE, TRUNCATE; and EXPLAIN ANALYZE and EXECUTE if the command they would execute is among those listed. This is a high-level notion of read-only that does not prevent writes to disk.  

NOTES

The session default transaction isolation level can also be set with the command

SET default_transaction_isolation = 'value'

and in the configuration file. Consult the section called ``Run-time Configuration'' in the documentation for more information.  

COMPATIBILITY

Both commands are defined in the SQL standard. SERIALIZABLE is the default transaction isolation level in the standard; in PostgreSQL the default is ordinarily READ COMMITTED, but you can change it as described above. PostgreSQL does not provide the isolation levels READ UNCOMMITTED and REPEATABLE READ. Because of multiversion concurrency control, the SERIALIZABLE level is not truly serializable. See the chapter called ``Concurrency Control'' in the documentation for details.

In the SQL standard, there is one other transaction characteristic that can be set with these commands: the size of the diagnostics area. This concept is only for use in embedded SQL.

責任編輯:韓亞珊 來源: CMPP.net
相關推薦

2011-08-24 18:19:13

START TRANS中文man

2011-08-24 17:50:19

SET中文man

2011-08-24 17:53:08

SET CONSTRA中文man

2011-08-24 17:58:08

SET SESSION中文man

2011-08-15 10:21:09

man中文man

2011-08-24 16:48:36

man中文man

2011-08-11 16:11:49

at中文man

2011-08-25 10:21:56

man.conf中文man

2011-08-11 15:03:21

ACCESS中文man

2011-08-11 15:28:43

ali中文man

2011-08-11 16:31:49

biff中文man

2011-08-11 17:16:43

cce中文man

2011-08-11 18:05:04

chvt中文man

2011-08-11 18:13:07

clear中文man

2011-08-12 09:13:02

df中文man

2011-08-12 09:38:06

dircolors中文man

2011-08-12 09:44:37

dirname中文man

2011-08-12 10:20:02

echo中文man

2011-08-12 10:25:55

eject中文man

2011-08-12 11:07:19

git中文man
點贊
收藏

51CTO技術棧公眾號

主站蜘蛛池模板: 国产一区二区在线免费播放 | 成人三区四区 | 在线观看视频h | 九九伦理片 | 日中文字幕在线 | 国产精品v | 久久中文视频 | 国产一区欧美 | 亚洲欧美中文日韩在线v日本 | 日韩av在线一区二区 | 日韩在线资源 | 国产二区av | 激情婷婷成人 | 国产精品一区久久久 | 9久9久 | 毛片网络 | 91文字幕巨乱亚洲香蕉 | 欧美一区二区三区一在线观看 | 精品国产一区二区三区性色av | 一级女毛片| 亚洲欧美一区二区三区1000 | 在线免费观看毛片 | 亚洲精品日韩在线 | 在线观看av网站永久 | 亚洲精品国产电影 | 一区二区在线免费观看 | 免费观看羞羞视频网站 | 欧美成人精品激情在线观看 | 精品一二区 | 久久久国产一区二区三区 | 午夜欧美 | 爽爽免费视频 | 狠狠色综合网站久久久久久久 | 国产黄色大片 | 日韩av一区二区在线观看 | 国产区精品视频 | 色婷婷一区二区三区四区 | 亚洲视频一区二区三区 | 一区在线视频 | 欧美二区在线 | 777zyz色资源站在线观看 |