X-Original-To: pgsql-docs-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 3DD39329D2A; Mon, 13 Sep 2004 18:35:03 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 73075-03; Mon, 13 Sep 2004 17:34:58 +0000 (GMT) Received: from Herge.rcsinc.local (mail.rcsonline.com [205.217.85.91]) by svr1.postgresql.org (Postfix) with ESMTP id C2B40329D20; Mon, 13 Sep 2004 18:34:55 +0100 (BST) Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable Subject: pg_locks view and user locks X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Date: Mon, 13 Sep 2004 13:34:05 -0400 Message-ID: <6EE64EF3AB31D5448D0007DD34EEB3412A74A8@Herge.rcsinc.local> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: pg_locks view and user locks Thread-Index: AcSZt92I+jlYoa/TRn+UEj/gF8VTAg== From: "Merlin Moncure" To: Cc: X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200409/24 X-Sequence-Number: 2543 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?=20 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