Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 6889113C6999 for ; Fri, 4 May 2012 06:54:35 -0300 (ADT) Received: from rs133.luxsci.com ([72.32.115.26]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SQFDe-0006eJ-C1 for pgsql-admin@postgresql.org; Fri, 04 May 2012 09:54:34 +0000 Received: from GNANAM (NSG-Static-236.156.72.182.airtel.in [182.72.156.236] (may be forged)) (authenticated bits=0) by rs133.luxsci.com (8.13.8/8.13.8) with ESMTP id q449s7XR024918; Fri, 4 May 2012 04:54:17 -0500 Reply-To: From: "Gnanakumar" To: "'Albe Laurenz'" , References: <008101cd2916$1c023b20$5406b160$@com> In-Reply-To: Subject: Re: Very long " in transaction" query Date: Fri, 4 May 2012 15:22:47 +0530 Organization: Zoniac Software Private Limited Message-ID: <008001cd29db$ab24ba60$016e2f20$@com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: Ac0pFhRfqWvBF5BbRGy7dyqTUWSSygAHxzPgAClwfOA= Content-Language: en-us X-Lux-Comment: Message q449s7XR024918 sent by user #22393 X-Pg-Spam-Score: 0.1 (/) X-Archive-Number: 201205/18 X-Sequence-Number: 39507 > SELECT application_name, client_addr, client_hostname, client_port > FROM pg_stat_activity > WHERE procpid = 14740; > (Replace 14740 of the process ID of the "idle in transaction" backend). > Look on the client machine and find the process that holds TCP port > "client_port" open (on Linux you can use "lsof" for that). Ours is a web-based application and all calls are made "only" from where the web server is running. No external calls are allowed in my case. Hence, the "only" client machine in my case is the web server.