Hi hackers, It seems that the descriptions of classid, objid, and objsubid in the pg_locks documentation are not quite accurate for all lock types. The documentation currently says these columns are null if the lock target is not a general database object. However, pg_lock_status() (lockfuncs.c) also populates these columns for other lock types, including advisory locks, speculative insertion locks, and apply transaction locks. The detailed prose below the table already describes some of these uses, so the table entries and the prose seem to be inconsistent.
The attached patch: 1. rewrites each column description to scope it to the general database object case, instead of making a false claim about NULL behavior for all other lock types; 2. adds a pointer to the detailed per-lock-type prose below; and 3. documents that apply transaction locks show the subscription OID in objid. I chose not to enumerate all non-object lock types in the column descriptions, since that seemed easy to let drift again as new lock types are added. Do you think? Regards, Hiroki Takamatsu
0001-clarify-pg_locks-descriptions-of-classid-objid-objsu.patch
Description: Binary data
