From 8ab9df0db196b6e1afa75838394eb27e9955e80e Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Mon, 28 Nov 2011 13:52:04 -0500 Subject: [PATCH] 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. --- doc/src/sgml/catalogs.sgml | 48 ++++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/doc/src/sgml/catalogs.sgml b/doc/src/sgml/catalogs.sgml index 32a51dbd8c..c467c8bdae 100644 --- a/doc/src/sgml/catalogs.sgml +++ b/doc/src/sgml/catalogs.sgml @@ -6885,6 +6885,8 @@ in the same way as in pg_description or pg_depend). Also, the right to extend a relation is represented as a separate lockable object. + Also, advisory locks can be taken on numbers that have + user-defined meanings. @@ -6985,9 +6987,7 @@ any OID column OID of the object within its system catalog, or null if the - object is not a general database object. - For advisory locks it is used to distinguish the two key - spaces (1 for an int8 key, 2 for two int4 keys). + object is not a general database object @@ -6995,10 +6995,11 @@ smallint - For a table column, this is the column number (the + Column number targeted by the lock (the classid and objid refer to the - table itself). For all other object types, this column is - zero. Null if the object is not a general database object + table itself), + or zero if the target is some other general database object, + or null if the target is not a general database object @@ -7015,7 +7016,7 @@ Process ID of the server process holding or awaiting this - lock. Null if the lock is held by a prepared transaction. + lock, or null if the lock is held by a prepared transaction @@ -7068,7 +7069,8 @@ Advisory locks can be acquired on keys consisting of either a single - bigint value or two integer values. A bigint key is displayed with its + bigint value or two integer values. + A bigint key is displayed with its high-order half in the classid column, its low-order half in the objid column, and objsubid equal to 1. Integer keys are displayed with the first key in the @@ -7078,21 +7080,6 @@ so the database column is meaningful for an advisory lock. - - The pg_locks view displays data from both the - regular lock manager and the predicate lock manager, which are - separate systems. When this view is accessed, the internal data - structures of each lock manager are momentarily locked, and copies are - made for the view to display. Each lock manager will therefore - produce a consistent set of results, but as we do not lock both lock - managers simultaneously, it is possible for locks to be taken or - released after we interrogate the regular lock manager and before we - interrogate the predicate lock manager. Each lock manager is only - locked for the minimum possible time so as to reduce the performance - impact of querying this view, but there could nevertheless be some - impact on database performance if it is frequently accessed. - - pg_locks provides a global view of all locks in the database cluster, not only those relevant to the current database. @@ -7117,6 +7104,21 @@ but it continues to hold the locks it acquired while running.) + + The pg_locks view displays data from both the + regular lock manager and the predicate lock manager, which are + separate systems. When this view is accessed, the internal data + structures of each lock manager are momentarily locked, and copies are + made for the view to display. Each lock manager will therefore + produce a consistent set of results, but as we do not lock both lock + managers simultaneously, it is possible for locks to be taken or + released after we interrogate the regular lock manager and before we + interrogate the predicate lock manager. Each lock manager is only + locked for the minimum possible time so as to reduce the performance + impact of querying this view, but there could nevertheless be some + impact on database performance if it is frequently accessed. + + -- 2.40.0