1
1
<!--
2
- $Header: /cvsroot/pgsql/doc/src/sgml/ref/begin.sgml,v 1.18 2002/08/04 04:31:44 momjian Exp $
2
+ $Header: /cvsroot/pgsql/doc/src/sgml/ref/begin.sgml,v 1.19 2002/08/30 22:45:25 tgl Exp $
3
3
PostgreSQL documentation
4
4
-->
5
5
@@ -103,33 +103,35 @@ WARNING: BEGIN: already a transaction in progress
103
103
<command>BEGIN</command> initiates a user transaction in chained mode,
104
104
i.e., all user statements after <command>BEGIN</command> command will
105
105
be executed in a single transaction until an explicit
106
- <xref linkend="sql-commit" endterm="sql-commit-title">,
107
- <xref linkend="sql-rollback" endterm="sql-rollback-title">,
108
- or execution abort. Statements in chained mode are executed much faster,
106
+ <xref linkend="sql-commit" endterm="sql-commit-title"> or
107
+ <xref linkend="sql-rollback" endterm="sql-rollback-title">.
108
+ Statements are executed more quickly in chained mode,
109
109
because transaction start/commit requires significant CPU and disk
110
110
activity. Execution of multiple statements inside a transaction
111
- is also required for consistency when changing several
112
- related tables.
111
+ is also useful to ensure consistency when changing several
112
+ related tables: other clients will be unable to see the intermediate
113
+ states wherein not all the related updates have been done.
113
114
</para>
114
115
115
116
<para>
116
117
The default transaction isolation level in
117
118
<productname>PostgreSQL</productname>
118
- is READ COMMITTED, where queries inside the transaction see only changes
119
- committed before query execution. So, you have to use
119
+ is READ COMMITTED, wherein each query inside the transaction sees changes
120
+ committed before that query begins execution. So, you have to use
120
121
<command>SET TRANSACTION ISOLATION LEVEL SERIALIZABLE</command>
121
- just after <command>BEGIN</command> if you need more rigorous transaction isolation.
122
+ just after <command>BEGIN</command> if you need more rigorous transaction
123
+ isolation. (Alternatively, you can change the default transaction
124
+ isolation level; see the <citetitle>PostgreSQL Administrator's
125
+ Guide</citetitle> for details.)
122
126
In SERIALIZABLE mode queries will see only changes committed before
123
127
the entire
124
128
transaction began (actually, before execution of the first DML statement
125
- in a serializable transaction).
129
+ in the transaction).
126
130
</para>
127
131
128
132
<para>
129
- If the transaction is committed, <productname>PostgreSQL</productname>
130
- will ensure either that all updates are done or else that none of
131
- them are done. Transactions have the standard <acronym>ACID</acronym>
132
- (atomic, consistent, isolatable, and durable) property.
133
+ Transactions have the standard <acronym>ACID</acronym>
134
+ (atomic, consistent, isolatable, and durable) properties.
133
135
</para>
134
136
135
137
<refsect2 id="R2-SQL-BEGIN-3">
@@ -140,9 +142,9 @@ WARNING: BEGIN: already a transaction in progress
140
142
Notes
141
143
</title>
142
144
<para>
143
- Refer to <xref linkend="sql-lock" endterm="sql-lock-title">
144
- for further information
145
- about locking tables inside a transaction .
145
+ <xref linkend="sql-start-transaction"
146
+ endterm="sql-start-transaction-title"> has the same functionality
147
+ as <command>BEGIN</> .
146
148
</para>
147
149
148
150
<para>
@@ -151,6 +153,17 @@ WARNING: BEGIN: already a transaction in progress
151
153
<xref linkend="SQL-ROLLBACK" endterm="SQL-ROLLBACK-TITLE">
152
154
to terminate a transaction.
153
155
</para>
156
+
157
+ <para>
158
+ Refer to <xref linkend="sql-lock" endterm="sql-lock-title">
159
+ for further information
160
+ about locking tables inside a transaction.
161
+ </para>
162
+
163
+ <para>
164
+ If you turn <literal>autocommit</> mode off, then <command>BEGIN</>
165
+ is not required: any SQL command automatically starts a transaction.
166
+ </para>
154
167
</refsect2>
155
168
</refsect1>
156
169
0 commit comments