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 93FF7D1B1B3 for ; Wed, 21 Jul 2004 17:04:22 -0300 (ADT) 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 27979-02 for ; Wed, 21 Jul 2004 20:04:14 +0000 (GMT) Received: from pegasus.host4u.net (pegasus.host4u.net [209.150.128.41]) by svr1.postgresql.org (Postfix) with ESMTP id BEF48D1B1C8 for ; Wed, 21 Jul 2004 17:04:11 -0300 (ADT) Received: from graciousstyle.com (ca-stmnca-cuda1-blade2b-207.stmnca.adelphia.net [68.65.195.207]) by pegasus.host4u.net (8.11.6/8.11.6) with ESMTP id i6LK4Cx20721 for ; Wed, 21 Jul 2004 15:04:12 -0500 Message-ID: <40FECC32.2010207@graciousstyle.com> Date: Wed, 21 Jul 2004 13:04:02 -0700 From: Si Chen Reply-To: schen@graciousstyle.com Organization: Gracious Style User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: en-us, en, zh-cn MIME-Version: 1.0 To: pgsql-admin@postgresql.org Subject: How to identify the transaction of a lock? Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.2 tagged_above=0.0 required=5.0 tests=RCVD_IN_RFCI, RCVD_IN_SORBS X-Spam-Level: X-Archive-Number: 200407/238 X-Sequence-Number: 14306 Hello. I am having a problem with a locked table that causes postmaster to hang on inserts. I went to pg_locks and got: transaction 6536720 pid 15992 mode ExclusiveLock granted t How do I go from this transaction identifier to finding out which transaction caused it to lock, so I can resolve it in my code? Thanks! Si Chen