| From: | Hiroki Takamatsu <hiroki(dot)takamatsu(dot)my(at)gmail(dot)com> |
|---|---|
| To: | pgsql-docs(at)postgresql(dot)org |
| Subject: | Doc: clarify pg_locks descriptions of classid/objid/objsubid |
| Date: | 2026-03-30 08:48:10 |
| Message-ID: | CA+r=ywWUHOPgHp-tegoETpfjiEkE5Ytzi4g9orcKav8bWym+_Q@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-docs |
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
| Attachment | Content-Type | Size |
|---|---|---|
| 0001-clarify-pg_locks-descriptions-of-classid-objid-objsu.patch | application/octet-stream | 3.0 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tom Lane | 2026-03-30 22:06:01 | Re: Correct docs about GiST leaf page structure |
| Previous Message | Paul A Jungwirth | 2026-03-30 01:37:18 | Re: cmax docs seem misleading |