Re: Need help understanding pg_locks - Mailing list pgsql-hackers

From Florian Pflug
Subject Re: Need help understanding pg_locks
Date
Msg-id 903BF130-C014-473E-B11A-0B873BA4124A@phlo.org
Whole thread Raw
In response to Re: Need help understanding pg_locks  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Need help understanding pg_locks
List pgsql-hackers
On Jul11, 2011, at 17:11 , Tom Lane wrote:
> Florian Pflug <fgp@phlo.org> writes:
>> On Jul11, 2011, at 05:47 , Bruce Momjian wrote:
>>> Thank you.  I think my confusion is that virtualtransaction is the lock
>>> holder/waiter, and the other two are actual locks.  The attached doc
>>> patch clarifies that.  I had actually realized this a few weeks ago and
>>> forgot, meaning this is pretty confusing.
> 
>> For consistency, I guess it should say "lock object" instead of simply
>> "object" the description of all the columns up to (and including)
>> "objsubid", not only those of "virtualxid" and "transactionid".
> 
> Yeah, I think this patch is going in the wrong direction altogether.
> It would be better to modify the description of virtualtransaction
> and pid to say that those are the "locking" entity.

Hm, we already kinda of say that. Both descriptions include the phrase
"... holding or awaiting this lock.". The column "mode" says
"... held or desired by this process", which I guess is similar enough
to make it clear that these are related.

Its the columns which refer to the locked object which simply say 
"object", and thus leave it open if that means locked or a locking.

Could we split that table in two parts, one for the fields referring
to the locked object and one for the locking entity, or does that depart
too far from the way we document other system catalogs and views?

If splitting it into two parts is too radical, how about adding a column
"Refers To" which says either "Locked Object" or "Locking Entity"?

best regards,
Florian Pflug





pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: txid_current() forces a real xid
Next
From: Tom Lane
Date:
Subject: Re: Need help understanding pg_locks