From 96889392e915e5c77384d274db2a2c42b684c274 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Thu, 6 Nov 2003 22:08:15 +0000 Subject: Implement isolation levels read uncommitted and repeatable read as acting like the next higher one. --- doc/src/sgml/mvcc.sgml | 23 ++++++++++++++++++++--- doc/src/sgml/ref/set_transaction.sgml | 29 +++++++++++++++++------------ doc/src/sgml/ref/start_transaction.sgml | 6 ++++-- doc/src/sgml/runtime.sgml | 12 +++++++----- 4 files changed, 48 insertions(+), 22 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/mvcc.sgml b/doc/src/sgml/mvcc.sgml index e46c5928c78..a56d4a18a92 100644 --- a/doc/src/sgml/mvcc.sgml +++ b/doc/src/sgml/mvcc.sgml @@ -1,5 +1,5 @@ @@ -206,8 +206,25 @@ $Header: /cvsroot/pgsql/doc/src/sgml/mvcc.sgml,v 2.40 2003/11/04 09:55:38 petere - PostgreSQL - offers the Read Committed and Serializable isolation levels. + In PostgreSQL, you can use all four + possible transaction isolation levels. Internally, there are only + two distinct isolation levels, which correspond to the levels Read + Committed and Serializable. When you select the level Read + Uncommitted you really get Read Committed, and when you select + Repeatable Read you really get Serializable, so the actual + isolation level may be stricter than what you select. This is + permitted by the SQL standard: the four isolation levels only + define which phenomena must not happen, they do not define which + phenomena must happen. The reason that PostgreSQL only provides + two isolation levels is that this is the only sensible way to map + the isolation levels to the multiversion concurrency control + architecture. The behavior of the available isolation levels is + detailed in the following subsections. + + + + To set the transaction isolation level of a transaction, use the + command . diff --git a/doc/src/sgml/ref/set_transaction.sgml b/doc/src/sgml/ref/set_transaction.sgml index cbe41d7175f..809b884d6ba 100644 --- a/doc/src/sgml/ref/set_transaction.sgml +++ b/doc/src/sgml/ref/set_transaction.sgml @@ -1,4 +1,4 @@ - + SET TRANSACTION @@ -17,9 +17,12 @@ SET TRANSACTION - [ ISOLATION LEVEL { READ COMMITTED | SERIALIZABLE } ] [ READ WRITE | READ ONLY ] + [ ISOLATION LEVEL { READ UNCOMMITTED | READ COMMITTED | REPEATABLE READ | SERIALIZABLE } ] + [ READ WRITE | READ ONLY ] + SET SESSION CHARACTERISTICS AS TRANSACTION - [ ISOLATION LEVEL { READ COMMITTED | SERIALIZABLE } ] [ READ WRITE | READ ONLY ] + [ ISOLATION LEVEL { READ UNCOMMITTED | READ COMMITTED | REPEATABLE READ | SERIALIZABLE } ] + [ READ WRITE | READ ONLY ] @@ -76,8 +79,11 @@ SET SESSION CHARACTERISTICS AS TRANSACTION - The transaction isolation level cannot be set after the first query - or data-modification statement (SELECT, + The level READ UNCOMMITTED is mapped to + READ COMMITTED, the level REPEATABLE + READ is mapped to SERIALIZABLE, 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 @@ -122,13 +128,12 @@ SET default_transaction_isolation = 'value' 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 for details. + isolation level in the standard; in + PostgreSQL the default is ordinarily + READ COMMITTED, but you can change it as + described above. Because of multiversion concurrency control, the + SERIALIZABLE level is not truly + serializable. See for details. diff --git a/doc/src/sgml/ref/start_transaction.sgml b/doc/src/sgml/ref/start_transaction.sgml index 60089d71ee9..7b1a2d58391 100644 --- a/doc/src/sgml/ref/start_transaction.sgml +++ b/doc/src/sgml/ref/start_transaction.sgml @@ -1,5 +1,5 @@ @@ -20,7 +20,9 @@ PostgreSQL documentation -START TRANSACTION [ ISOLATION LEVEL { READ COMMITTED | SERIALIZABLE } ] [ READ WRITE | READ ONLY ] +START TRANSACTION + [ ISOLATION LEVEL { READ UNCOMMITTED | READ COMMITTED | REPEATABLE READ | SERIALIZABLE } ] + [ READ WRITE | READ ONLY ] diff --git a/doc/src/sgml/runtime.sgml b/doc/src/sgml/runtime.sgml index e6a9478cbb1..d23c78d0cc5 100644 --- a/doc/src/sgml/runtime.sgml +++ b/doc/src/sgml/runtime.sgml @@ -1,5 +1,5 @@ @@ -2043,10 +2043,12 @@ SET ENABLE_SEQSCAN TO OFF; default_transaction_isolation (string) - Each SQL transaction has an isolation level, which can be either - read committed or serializable. - This parameter controls the default isolation level of each new - transaction. The default is read committed. + Each SQL transaction has an isolation level, which can be + either read uncommitted, read + committed, repeatable read, or + serializable. This parameter controls the + default isolation level of each new transaction. The default + is read committed. -- cgit v1.2.3