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 83E34329E78 for ; Mon, 13 Sep 2004 22:31:33 +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 54266-08 for ; Mon, 13 Sep 2004 21:31:27 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 5CDC1329E69 for ; Mon, 13 Sep 2004 22:31:29 +0100 (BST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.11/8.12.11) with ESMTP id i8DLVFDO024424; Mon, 13 Sep 2004 17:31:16 -0400 (EDT) To: Alvaro Herrera Cc: Merlin Moncure , pgsql-hackers@postgresql.org, pgsql-docs@postgresql.org Subject: Re: [HACKERS] pg_locks view and user locks In-reply-to: <20040913200225.GA5061@dcc.uchile.cl> References: <6EE64EF3AB31D5448D0007DD34EEB3412A74A8@Herge.rcsinc.local> <20040913200225.GA5061@dcc.uchile.cl> Comments: In-reply-to Alvaro Herrera message dated "Mon, 13 Sep 2004 16:02:25 -0400" Date: Mon, 13 Sep 2004 17:31:15 -0400 Message-ID: <24423.1095111075@sss.pgh.pa.us> From: Tom Lane 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/27 X-Sequence-Number: 2546 Alvaro Herrera writes: > ISTM it would be better to have pg_locks show only system locks, and > another view, say pg_userlocks, to show user locks. This would allow to > show different data; for example, the PID of the process involved. I think this is a bad idea, at least for the base-level view, because it would imply that it's impossible to get a truly simultaneous view of the state of all the locks. It would certainly be a bad idea to so separate xact and table locks. I'd prefer to extend the present approach and add columns that are NULL when the type of lock isn't relevant to them. > Another option would be to add another column to pg_locks to say what > lockmethod (1 for system, 2 for user) is used in each lock. How about a text column with values "TABLE", "XACT", "USER"? regards, tom lane