Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 8ab9df0

Browse files
committed
Remove erroneous claim about use of pg_locks.objid for advisory locks.
The correct information appears in the text, so just remove the statement in the table, where it did not fit nicely anyway. (Curiously, the correct info has been there much longer than the erroneous table entry.) Resolves problem noted by Daniele Varrazzo. In HEAD and 9.1, also do a bit of wordsmithing on other text on the page.
1 parent 5c19c05 commit 8ab9df0

File tree

1 file changed

+25
-23
lines changed

1 file changed

+25
-23
lines changed

doc/src/sgml/catalogs.sgml

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6885,6 +6885,8 @@
68856885
in the same way as in <structname>pg_description</structname> or
68866886
<structname>pg_depend</structname>). Also, the right to extend a
68876887
relation is represented as a separate lockable object.
6888+
Also, <quote>advisory</> locks can be taken on numbers that have
6889+
user-defined meanings.
68886890
</para>
68896891

68906892
<table>
@@ -6985,20 +6987,19 @@
69856987
<entry>any OID column</entry>
69866988
<entry>
69876989
OID of the object within its system catalog, or null if the
6988-
object is not a general database object.
6989-
For advisory locks it is used to distinguish the two key
6990-
spaces (1 for an int8 key, 2 for two int4 keys).
6990+
object is not a general database object
69916991
</entry>
69926992
</row>
69936993
<row>
69946994
<entry><structfield>objsubid</structfield></entry>
69956995
<entry><type>smallint</type></entry>
69966996
<entry></entry>
69976997
<entry>
6998-
For a table column, this is the column number (the
6998+
Column number targeted by the lock (the
69996999
<structfield>classid</> and <structfield>objid</> refer to the
7000-
table itself). For all other object types, this column is
7001-
zero. Null if the object is not a general database object
7000+
table itself),
7001+
or zero if the target is some other general database object,
7002+
or null if the target is not a general database object
70027003
</entry>
70037004
</row>
70047005
<row>
@@ -7015,7 +7016,7 @@
70157016
<entry></entry>
70167017
<entry>
70177018
Process ID of the server process holding or awaiting this
7018-
lock. Null if the lock is held by a prepared transaction.
7019+
lock, or null if the lock is held by a prepared transaction
70197020
</entry>
70207021
</row>
70217022
<row>
@@ -7068,7 +7069,8 @@
70687069

70697070
<para>
70707071
Advisory locks can be acquired on keys consisting of either a single
7071-
<type>bigint</type> value or two integer values. A <type>bigint</type> key is displayed with its
7072+
<type>bigint</type> value or two integer values.
7073+
A <type>bigint</type> key is displayed with its
70727074
high-order half in the <structfield>classid</> column, its low-order half
70737075
in the <structfield>objid</> column, and <structfield>objsubid</> equal
70747076
to 1. Integer keys are displayed with the first key in the
@@ -7078,21 +7080,6 @@
70787080
so the <structfield>database</> column is meaningful for an advisory lock.
70797081
</para>
70807082

7081-
<para>
7082-
The <structname>pg_locks</structname> view displays data from both the
7083-
regular lock manager and the predicate lock manager, which are
7084-
separate systems. When this view is accessed, the internal data
7085-
structures of each lock manager are momentarily locked, and copies are
7086-
made for the view to display. Each lock manager will therefore
7087-
produce a consistent set of results, but as we do not lock both lock
7088-
managers simultaneously, it is possible for locks to be taken or
7089-
released after we interrogate the regular lock manager and before we
7090-
interrogate the predicate lock manager. Each lock manager is only
7091-
locked for the minimum possible time so as to reduce the performance
7092-
impact of querying this view, but there could nevertheless be some
7093-
impact on database performance if it is frequently accessed.
7094-
</para>
7095-
70967083
<para>
70977084
<structname>pg_locks</structname> provides a global view of all locks
70987085
in the database cluster, not only those relevant to the current database.
@@ -7117,6 +7104,21 @@
71177104
but it continues to hold the locks it acquired while running.)
71187105
</para>
71197106

7107+
<para>
7108+
The <structname>pg_locks</structname> view displays data from both the
7109+
regular lock manager and the predicate lock manager, which are
7110+
separate systems. When this view is accessed, the internal data
7111+
structures of each lock manager are momentarily locked, and copies are
7112+
made for the view to display. Each lock manager will therefore
7113+
produce a consistent set of results, but as we do not lock both lock
7114+
managers simultaneously, it is possible for locks to be taken or
7115+
released after we interrogate the regular lock manager and before we
7116+
interrogate the predicate lock manager. Each lock manager is only
7117+
locked for the minimum possible time so as to reduce the performance
7118+
impact of querying this view, but there could nevertheless be some
7119+
impact on database performance if it is frequently accessed.
7120+
</para>
7121+
71207122
</sect1>
71217123

71227124
<sect1 id="view-pg-prepared-statements">

0 commit comments

Comments
 (0)