X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 2AAA05296E for ; Fri, 1 Apr 2005 00:48:45 +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 16225-01 for ; Thu, 31 Mar 2005 23:48:38 +0000 (GMT) Received: from hotmail.com (bay20-f26.bay20.hotmail.com [64.4.54.115]) by svr1.postgresql.org (Postfix) with ESMTP id 7AB735374F for ; Fri, 1 Apr 2005 00:48:35 +0100 (BST) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Thu, 31 Mar 2005 15:48:38 -0800 Message-ID: Received: from 202.49.200.143 by by20fd.bay20.hotmail.msn.com with HTTP; Thu, 31 Mar 2005 23:48:37 GMT X-Originating-IP: [202.49.200.143] X-Originating-Email: [adrianengelbrecht@hotmail.com] X-Sender: adrianengelbrecht@hotmail.com From: "Adrian Engelbrecht" To: pgsql-admin@postgresql.org Subject: How to associate locks with a Postgres object Date: Fri, 01 Apr 2005 11:48:37 +1200 Mime-Version: 1.0 Content-Type: text/html; format=flowed X-OriginalArrivalTime: 31 Mar 2005 23:48:38.0220 (UTC) FILETIME=[28F0A0C0:01C5364C] X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=2.995 tagged_above=0 required=5 tests=DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_POST, HTML_40_50, HTML_MESSAGE, MIME_HTML_ONLY, MSGID_FROM_MTA_HEADER X-Spam-Level: ** X-Archive-Number: 200504/2 X-Sequence-Number: 17015

I have written the following query that ties together locks with databases and users, but I cannot determine from the columns in each of the views used how to associate this data with objects (tables, views, rows) in the Postgres database:-


select
relation
, transaction
, pid
, mode
, granted
, datname
, procpid
, u.usesysid
, u.usename
, usesuper
--*
from pg_locks l, pg_stat_activity s, pg_user u
where l.pid = s.procpid and s.usesysid = u.usesysid
order by l.pid;

Help please?

Adrian



Become a fitness fanatic with XtraMSN Health & Fitness!