Wrong advisory locks docs in pg_locks

Started by Daniele Varrazzoover 14 years ago2 messagesdocs
Jump to latest
#1Daniele Varrazzo
daniele.varrazzo@gmail.com

Hello,

documentation about advisory locks in the pg_locks view
<http://developer.postgresql.org/pgdocs/postgres/view-pg-locks.html&gt;
is incorrect/incomplete: the space specifier field is objsubid, not
objid, and there is no information about how the key is stored.

=> select pg_advisory_lock(1111, 2222);
=> select pg_advisory_lock((3333 * 2^32 + 4444)::bigint);
=> select classid, objid, objsubid from pg_locks where locktype='advisory';
classid | objid | objsubid
---------+-------+----------
3333 | 4444 | 1
1111 | 2222 | 2

I've only checked the classid/objid/objsubid fields, don't know about
the other ones.

Proposed patch attached.

-- Daniele

Attachments:

advisory-locks-doc.patchtext/x-patch; charset=US-ASCII; name=advisory-locks-doc.patchDownload+8-4
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Daniele Varrazzo (#1)
Re: Wrong advisory locks docs in pg_locks

Daniele Varrazzo <daniele.varrazzo@gmail.com> writes:

documentation about advisory locks in the pg_locks view
<http://developer.postgresql.org/pgdocs/postgres/view-pg-locks.html&gt;
is incorrect/incomplete: the space specifier field is objsubid, not
objid, and there is no information about how the key is stored.

Actually, there is a paragraph further down that correctly explains what
advisory locks look like. I think the best fix is to remove the
incorrect annotation on objid and leave it at that; shoehorning
additional sentences into table columns that are meant to contain
short phrases is not an improvement.

regards, tom lane