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

From Bruce Momjian
Subject Re: Need help understanding pg_locks
Date
Msg-id 201107131607.p6DG7VH27321@momjian.us
Whole thread Raw
In response to Re: Need help understanding pg_locks  (Florian Pflug <fgp@phlo.org>)
List pgsql-hackers
Florian Pflug wrote:
> On Jul13, 2011, at 17:44 , Tom Lane wrote:
> > Bruce Momjian <bruce@momjian.us> writes:
> >> OK, I went with this wording, using "lock object is on" terminology. 
> >> Applied patch attached --- adjustments welcomed.
> > 
> > I think you misunderstood the suggestion.  This is not an improvement,
> > it's just more confusion.
> 
> FWIW, I agree. First, "lock object" seems redundant - you might just as
> well say simply "lock". This is different from "locked object" - there,
> the noun "object" servers as a dummy that gives the adjective "locked"
> something to refer to.

I would personally prefer "lock" rather than "lock object".

> Also, it now sounds as if we were talking about the storage
> location of the lock (as an entity in itself) in some of the sentences.
> 
> Here's an example
> 
>   "Page number within the relation, or null if the lock object
>    is not on a tuple or relation page".
> 
> To me at least, that sounds as if the lock might somehow be stored
> on a "relation page".
> 
> Maybe "on" is still too generic. What if we said "protects" instead?
> That makes the intended relationship between the lock and the
> tuple/relation/... much clearer. We'd then say
> 
>   (A)
>   "Protected page number within the relation, or null if the lock
>    does not protect a tuple or relation page".
> 
> Another possibility is to make the relationship clearer by adding
> the adjective "locked" before the locked thing, as in
> 
>   (B)
>   "Locked page number within the relation, or null if the lock
>    is not on a tuple or relation page".

Yes, I like this --- putting the "Locked at the front".  The old code
says things like "Page number within the relation" which is kind of
generic.

> 
> The latter also works "lock .. on .. " with
> "locked object ... is ...", i.e.
> 
>   (C)
>   "Locked page number within the relation, or null if the locked object
>    is not a tuple or relation page".
> 
> We could also get rid of the noun completely by saying
> 
>   (D)
>   "Locked page number within the relation, or null if it isn't
>    a tuple or relation page that is locked".

> 
> I personally slightly favor (D).

Me too.  Others?

--  Bruce Momjian  <bruce@momjian.us>        http://momjian.us EnterpriseDB
http://enterprisedb.com
 + It's impossible for everything to be true. +


pgsql-hackers by date:

Previous
From: Florian Pflug
Date:
Subject: Re: Need help understanding pg_locks
Next
From: "David E. Wheeler"
Date:
Subject: Re: Full GUID support