Re: Need help understanding pg_locks

From: Florian Pflug <fgp(at)phlo(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Need help understanding pg_locks
Date: 2011-07-11 15:21:39
Message-ID: 903BF130-C014-473E-B11A-0B873BA4124A@phlo.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Jul11, 2011, at 17:11 , Tom Lane wrote:
> Florian Pflug <fgp(at)phlo(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2011-07-11 15:26:22 Re: Need help understanding pg_locks
Previous Message Tom Lane 2011-07-11 15:18:06 Re: txid_current() forces a real xid