summaryrefslogtreecommitdiffstats
path: root/doc/src/sgml/man7/START_TRANSACTION.7
blob: 3c89d048e140bae8b8f2a619a11e545b575d4432 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
'\" t
.\"     Title: START TRANSACTION
.\"    Author: The PostgreSQL Global Development Group
.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
.\"      Date: 2024
.\"    Manual: PostgreSQL 15.7 Documentation
.\"    Source: PostgreSQL 15.7
.\"  Language: English
.\"
.TH "START TRANSACTION" "7" "2024" "PostgreSQL 15.7" "PostgreSQL 15.7 Documentation"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
START_TRANSACTION \- start a transaction block
.SH "SYNOPSIS"
.sp
.nf
START TRANSACTION [ \fItransaction_mode\fR [, \&.\&.\&.] ]

where \fItransaction_mode\fR is one of:

    ISOLATION LEVEL { SERIALIZABLE | REPEATABLE READ | READ COMMITTED | READ UNCOMMITTED }
    READ WRITE | READ ONLY
    [ NOT ] DEFERRABLE
.fi
.SH "DESCRIPTION"
.PP
This command begins a new transaction block\&. If the isolation level, read/write mode, or deferrable mode is specified, the new transaction has those characteristics, as if
\fBSET TRANSACTION\fR
was executed\&. This is the same as the
\fBBEGIN\fR
command\&.
.SH "PARAMETERS"
.PP
Refer to
SET TRANSACTION (\fBSET_TRANSACTION\fR(7))
for information on the meaning of the parameters to this statement\&.
.SH "COMPATIBILITY"
.PP
In the standard, it is not necessary to issue
\fBSTART TRANSACTION\fR
to start a transaction block: any SQL command implicitly begins a block\&.
PostgreSQL\*(Aqs behavior can be seen as implicitly issuing a
\fBCOMMIT\fR
after each command that does not follow
\fBSTART TRANSACTION\fR
(or
\fBBEGIN\fR), and it is therefore often called
\(lqautocommit\(rq\&. Other relational database systems might offer an autocommit feature as a convenience\&.
.PP
The
DEFERRABLE
\fItransaction_mode\fR
is a
PostgreSQL
language extension\&.
.PP
The SQL standard requires commas between successive
\fItransaction_modes\fR, but for historical reasons
PostgreSQL
allows the commas to be omitted\&.
.PP
See also the compatibility section of
SET TRANSACTION (\fBSET_TRANSACTION\fR(7))\&.
.SH "SEE ALSO"
\fBBEGIN\fR(7), \fBCOMMIT\fR(7), \fBROLLBACK\fR(7), \fBSAVEPOINT\fR(7), SET TRANSACTION (\fBSET_TRANSACTION\fR(7))