1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
8
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
10
HREF="mailto:pgsql-docs@postgresql.org"><LINK
12
TITLE="PostgreSQL 9.1beta1 Documentation"
13
HREF="index.html"><LINK
16
HREF="sql-commands.html"><LINK
19
HREF="sql-analyze.html"><LINK
22
HREF="sql-checkpoint.html"><LINK
25
HREF="stylesheet.css"><META
26
HTTP-EQUIV="Content-Type"
27
CONTENT="text/html; charset=ISO-8859-1"><META
29
CONTENT="2011-04-27T21:20:33"></HEAD
35
SUMMARY="Header navigation table"
47
>PostgreSQL 9.1beta1 Documentation</A
57
HREF="sql-analyze.html"
67
HREF="sql-analyze.html"
81
HREF="sql-checkpoint.html"
90
HREF="sql-checkpoint.html"
111
>BEGIN -- start a transaction block</DIV
113
CLASS="REFSYNOPSISDIV"
121
>BEGIN [ WORK | TRANSACTION ] [ <TT
141
ISOLATION LEVEL { SERIALIZABLE | REPEATABLE READ | READ COMMITTED | READ UNCOMMITTED }
142
READ WRITE | READ ONLY
143
[ NOT ] DEFERRABLE</PRE
156
> initiates a transaction block, that is,
157
all statements after a <TT
161
executed in a single transaction until an explicit <A
162
HREF="sql-commit.html"
165
HREF="sql-rollback.html"
168
By default (without <TT
176
transactions in <SPAN
179
> mode, that is, each
180
statement is executed in its own transaction and a commit is
181
implicitly performed at the end of the statement (if execution was
182
successful, otherwise a rollback is done).
185
> Statements are executed more quickly in a transaction block, because
186
transaction start/commit requires significant CPU and disk
187
activity. Execution of multiple statements inside a transaction is
188
also useful to ensure consistency when making several related changes:
189
other sessions will be unable to see the intermediate states
190
wherein not all the related updates have been done.
193
> If the isolation level, read/write mode, or deferrable mode is specified, the new
194
transaction has those characteristics, as if
196
HREF="sql-set-transaction.html"
224
> Optional key words. They have no effect.
231
HREF="sql-set-transaction.html"
233
> for information on the meaning
234
of the other parameters to this statement.
246
HREF="sql-start-transaction.html"
247
>START TRANSACTION</A
248
> has the same functionality
256
HREF="sql-commit.html"
260
HREF="sql-rollback.html"
263
to terminate a transaction block.
269
> when already inside a transaction block will
270
provoke a warning message. The state of the transaction is not affected.
271
To nest transactions within a transaction block, use savepoints
273
HREF="sql-savepoint.html"
278
> For reasons of backwards compatibility, the commas between successive
282
>transaction_modes</I
296
> To begin a transaction block:
299
CLASS="PROGRAMLISTING"
319
language extension. It is equivalent to the SQL-standard command
321
HREF="sql-start-transaction.html"
322
>START TRANSACTION</A
323
>, whose reference page
324
contains additional compatibility information.
340
> language extension.
343
> Incidentally, the <TT
346
> key word is used for a
347
different purpose in embedded SQL. You are advised to be careful
348
about the transaction semantics when porting database applications.
359
HREF="sql-commit.html"
362
HREF="sql-rollback.html"
365
HREF="sql-start-transaction.html"
366
>START TRANSACTION</A
368
HREF="sql-savepoint.html"
376
SUMMARY="Footer navigation table"
387
HREF="sql-analyze.html"
405
HREF="sql-checkpoint.html"
421
HREF="sql-commands.html"
b'\\ No newline at end of file'