File tree 3 files changed +15
-23
lines changed 3 files changed +15
-23
lines changed Original file line number Diff line number Diff line change 18
18
<DATE>1998-09-24</DATE>
19
19
</REFSYNOPSISDIVINFO>
20
20
<SYNOPSIS>
21
- LOCK [ TABLE ] <REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE>
21
+ LOCK [ TABLE ] [[IN] [ROW|ACCESS] [SHARE|EXCLUSIVE] MODE] <REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE>
22
22
</SYNOPSIS>
23
23
24
24
<REFSECT2 ID="R2-SQL-LOCK-1">
55
55
<PARA>
56
56
57
57
<VARIABLELIST>
58
- <VARLISTENTRY>
59
- <TERM>
60
- DELETE 0
61
- </TERM>
62
- <LISTITEM>
63
- <PARA>
64
- Message returned on a successful lock.
65
- <command>LOCK</command> is implemented as a
66
- <command>DELETE FROM <REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE></command>
67
- which is guaranteed to not delete any rows.
68
- </para>
69
- </listitem>
70
- </varlistentry>
71
- <VARLISTENTRY>
72
58
<TERM>
73
59
ERROR <REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE>: Table does not exist.
74
60
</TERM>
92
78
Description
93
79
</TITLE>
94
80
<PARA>
95
- <command>LOCK</command> locks in exclusive mode a table inside
96
- a transaction. The classic use for this is
81
+ By default, <command>LOCK</command> locks in exclusive mode a table inside
82
+ a transaction. Various options allow shared access, or row-level locking
83
+ control. The classic use for this is
97
84
the case where you want to select some data, then
98
85
update it inside a transaction.
99
86
If you don't explicit lock a table using LOCK statement, it will be
183
170
<PARA>
184
171
There is no <command>LOCK TABLE</command> in <acronym>SQL92</acronym>,
185
172
which instead uses <command>SET TRANSACTION</command> to specify
186
- concurrency level on transactions.
173
+ concurrency level on transactions. We support that too.
187
174
</para>
188
175
</refsect2>
189
176
</refsect1>
Original file line number Diff line number Diff line change 5
5
*
6
6
* Copyright (c) 1994, Regents of the University of California
7
7
*
8
- * $Id: psqlHelp.h,v 1.66 1999/06/03 18:37 :59 momjian Exp $
8
+ * $Id: psqlHelp.h,v 1.67 1999/06/03 19:17 :59 momjian Exp $
9
9
*
10
10
*-------------------------------------------------------------------------
11
11
*/
@@ -283,7 +283,8 @@ static struct _helpStruct QL_HELP[] = {
283
283
{"lock" ,
284
284
"exclusive lock a table inside a transaction" ,
285
285
"\
286
- \tLOCK [TABLE] class_name;" },
286
+ \tLOCK [TABLE] class_name \n\
287
+ \t[[IN] [ROW|ACCESS] [SHARE|EXCLUSIVE] MODE];" },
287
288
{"move" ,
288
289
"move an cursor position" ,
289
290
"\
Original file line number Diff line number Diff line change 1
1
.\" This is -*-nroff-*-
2
2
.\" XXX standard disclaimer belongs here....
3
- .\" $Header: /cvsroot/pgsql/src/man/Attic/lock.l,v 1.5 1998/03/23 15:09:34 momjian Exp $
3
+ .\" $Header: /cvsroot/pgsql/src/man/Attic/lock.l,v 1.6 1999/06/03 19:18:00 momjian Exp $
4
4
.TH FETCH SQL 01/23/93 PostgreSQL PostgreSQL
5
5
.SH NAME
6
6
lock - exclusive lock a table
7
7
.SH SYNOPSIS
8
8
.nf
9
- \fB lock \fR [\fB table \fR ] classname
9
+ \fB lock \fR [\fB table \fR ] classname [[IN] [ROW|ACCESS] [SHARE|EXCLUSIVE] MODE]
10
10
.fi
11
11
.SH DESCRIPTION
12
+ By default,
12
13
.BR lock
13
- exclusive locks a table inside a transaction. The classic use for this
14
+ exclusive locks an entire table inside a transaction.
15
+ Various options allow shared access, or row-level locking control.
16
+ .PP
17
+ The classic use for this
14
18
is the case where you want to \fB select \fP some data, then update it
15
19
inside a transaction. If you don't exclusive lock the table before the
16
20
\fB select \fP , some other user may also read the selected data, and try
You can’t perform that action at this time.
0 commit comments