Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 52C9A1337BCA for ; Thu, 17 Feb 2011 22:48:41 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 78963-01 for ; Fri, 18 Feb 2011 02:48:34 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pw0-f46.google.com (mail-pw0-f46.google.com [209.85.160.46]) by mail.postgresql.org (Postfix) with ESMTP id AA7A41337BC4 for ; Thu, 17 Feb 2011 22:48:33 -0400 (AST) Received: by pwj3 with SMTP id 3so521174pwj.19 for ; Thu, 17 Feb 2011 18:48:33 -0800 (PST) Received: by 10.142.218.13 with SMTP id q13mr128947wfg.416.1297997313692; Thu, 17 Feb 2011 18:48:33 -0800 (PST) Received: from Issac.consistentstate.com (c-67-165-192-103.hsd1.co.comcast.net [67.165.192.103]) by mx.google.com with ESMTPS id w27sm530286wfd.16.2011.02.17.18.48.32 (version=SSLv3 cipher=OTHER); Thu, 17 Feb 2011 18:48:32 -0800 (PST) Message-ID: <4D5DDDFE.4000807@consistentstate.com> Date: Thu, 17 Feb 2011 19:48:30 -0700 From: CS DBA User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101208 Red Hat/3.1.7-3.el6_0 Lightning/1.0b2 Thunderbird/3.1.7 MIME-Version: 1.0 To: Tom Lane CC: pgsql-admin@postgresql.org Subject: Re: finding the procpid (or pid) for a prepared transaction References: <4D5DD51C.30600@consistentstate.com> <18661.1297995564@sss.pgh.pa.us> In-Reply-To: <18661.1297995564@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.6 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7 X-Spam-Level: X-Archive-Number: 201102/167 X-Sequence-Number: 36806 On 02/17/2011 07:19 PM, Tom Lane wrote: > CS DBA writes: >> I have several prepared tx which are running for a long long time. I >> want to kill 'em but I dont know the process id. > If they're prepared, they're *not* running, and they don't have a > process id. They're just going to sit there until you do COMMIT > PREPARED or ROLLBACK PREPARED. > > regards, tom lane aah, makes sense Thanks. So, for future reference.. if I prepare a tx, and then execute the prepared stmt, is there a way to associate the xid from a prepared txn (pg_prepared_xacts) with the row in pg_stat_activity showing the executing prepared stmt (within the current prepared txn)? or is there a way to see the text of a currently prepared txn so I can look for the statement being executed in pg_stat_activity?