Skip site navigation (1) Skip section navigation (2)

pg_locks view and user locks

From: "Merlin Moncure" <merlin(dot)moncure(at)rcsonline(dot)com>
To: <pgsql-hackers(at)postgresql(dot)org>
Cc: <pgsql-docs(at)postgresql(dot)org>
Subject: pg_locks view and user locks
Date: 2004-09-13 17:34:05
Message-ID: 6EE64EF3AB31D5448D0007DD34EEB3412A74A8@Herge.rcsinc.local (view raw or flat)
Thread:
Lists: pgsql-docspgsql-hackers
I've been knocking around a bit with user level locks and I have a few
suggestions/questions:

First, the pg_locks view lists user level locks but doesn't really say
much about them.  For example, for traditional locks we get the xid but
for user locks we don't really get anything useful.  I looked in
lockfuncs.c and didn't see that there would be any real penalty to
displaying the offset/block of the user lock, and returning it in
request from pg_locks.  Is this view frequently queried by system
processes? 

Why would we want to do this?  Well it makes resolving a user lock to a
specific pid easier...admittedly of dubious value but helpful to
me...although if this doesn't fly I can always create an alternate view
which serves my purpose (and perhaps add a high level function to the
/contrib userlock module).

Second,
Is there a reason why user level locks are completely undocumented?
AFAICT, There is no mention of them in anywhere in the docs,
particularly 12.4, which describes methods for application managed
concurrency.  The availability of cooperative long term locks is (IMO) a
really nice feature, particularly for people porting legacy applications
which depend on explicit locking (there is some good info in the user
lock module which is unfortunately under the GPL).

Not complaining or looking for help, just curious why they seemed to
have slipped through the cracks.

Merlin


Responses

pgsql-docs by date

Next:From: Peter EisentrautDate: 2004-09-13 19:36:19
Subject: Re: pg_locks view and user locks
Previous:From: Richard FreytagDate: 2004-09-13 12:46:33
Subject: XOR example error in docs

pgsql-hackers by date

Next:From: Peter EisentrautDate: 2004-09-13 19:36:19
Subject: Re: pg_locks view and user locks
Previous:From: Sailesh KrishnamurthyDate: 2004-09-13 17:24:05
Subject: Re: APR 1.0 released

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group