Skip to content

Commit e1ea7cc

Browse files
committed
Update lock sgml/man/psql help pages.
1 parent 4a077ca commit e1ea7cc

File tree

3 files changed

+15
-23
lines changed

3 files changed

+15
-23
lines changed

doc/src/sgml/ref/lock.sgml

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<DATE>1998-09-24</DATE>
1919
</REFSYNOPSISDIVINFO>
2020
<SYNOPSIS>
21-
LOCK [ TABLE ] <REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE>
21+
LOCK [ TABLE ] [[IN] [ROW|ACCESS] [SHARE|EXCLUSIVE] MODE] <REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE>
2222
</SYNOPSIS>
2323

2424
<REFSECT2 ID="R2-SQL-LOCK-1">
@@ -55,20 +55,6 @@
5555
<PARA>
5656

5757
<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>
7258
<TERM>
7359
ERROR <REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE>: Table does not exist.
7460
</TERM>
@@ -92,8 +78,9 @@
9278
Description
9379
</TITLE>
9480
<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
9784
the case where you want to select some data, then
9885
update it inside a transaction.
9986
If you don't explicit lock a table using LOCK statement, it will be
@@ -183,7 +170,7 @@
183170
<PARA>
184171
There is no <command>LOCK TABLE</command> in <acronym>SQL92</acronym>,
185172
which instead uses <command>SET TRANSACTION</command> to specify
186-
concurrency level on transactions.
173+
concurrency level on transactions. We support that too.
187174
</para>
188175
</refsect2>
189176
</refsect1>

src/bin/psql/psqlHelp.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* Copyright (c) 1994, Regents of the University of California
77
*
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 $
99
*
1010
*-------------------------------------------------------------------------
1111
*/
@@ -283,7 +283,8 @@ static struct _helpStruct QL_HELP[] = {
283283
{"lock",
284284
"exclusive lock a table inside a transaction",
285285
"\
286-
\tLOCK [TABLE] class_name;"},
286+
\tLOCK [TABLE] class_name \n\
287+
\t[[IN] [ROW|ACCESS] [SHARE|EXCLUSIVE] MODE];"},
287288
{"move",
288289
"move an cursor position",
289290
"\

src/man/lock.l

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
.\" This is -*-nroff-*-
22
.\" 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 $
44
.TH FETCH SQL 01/23/93 PostgreSQL PostgreSQL
55
.SH NAME
66
lock - exclusive lock a table
77
.SH SYNOPSIS
88
.nf
9-
\fBlock\fR [\fBtable\fR] classname
9+
\fBlock\fR [\fBtable\fR] classname [[IN] [ROW|ACCESS] [SHARE|EXCLUSIVE] MODE]
1010
.fi
1111
.SH DESCRIPTION
12+
By default,
1213
.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
1418
is the case where you want to \fBselect\fP some data, then update it
1519
inside a transaction. If you don't exclusive lock the table before the
1620
\fBselect\fP, some other user may also read the selected data, and try

0 commit comments

Comments
 (0)