Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 68F8F1337BC4 for ; Thu, 17 Feb 2011 22:51:54 -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 51680-07 for ; Fri, 18 Feb 2011 02:51:43 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pz0-f46.google.com (mail-pz0-f46.google.com [209.85.210.46]) by mail.postgresql.org (Postfix) with ESMTP id AF0FF1337BCD for ; Thu, 17 Feb 2011 22:51:42 -0400 (AST) Received: by pzk35 with SMTP id 35so470675pzk.19 for ; Thu, 17 Feb 2011 18:51:43 -0800 (PST) Received: by 10.142.139.18 with SMTP id m18mr135996wfd.287.1297997502581; Thu, 17 Feb 2011 18:51:42 -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 w11sm2095272wfh.18.2011.02.17.18.51.41 (version=SSLv3 cipher=OTHER); Thu, 17 Feb 2011 18:51:41 -0800 (PST) Message-ID: <4D5DDEBC.7090508@consistentstate.com> Date: Thu, 17 Feb 2011 19:51:40 -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> <4D5DDDFE.4000807@consistentstate.com> In-Reply-To: <4D5DDDFE.4000807@consistentstate.com> 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/168 X-Sequence-Number: 36807 On 02/17/2011 07:48 PM, CS DBA wrote: > 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? > > > nevermind.... sorry I'm confusing prepared txn's with prepared stmts. -- --------------------------------------------- Kevin Kempter - Constent State A PostgreSQL Professional Services Company www.consistentstate.com ---------------------------------------------