Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 39FFB13C699A for ; Fri, 4 May 2012 08:34:23 -0300 (ADT) Received: from rs133.luxsci.com ([72.32.115.26]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SQGmC-0003Tt-8q for pgsql-admin@postgresql.org; Fri, 04 May 2012 11:34:22 +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 q44BXlju020114; Fri, 4 May 2012 06:34:04 -0500 Reply-To: From: "Gnanakumar" To: "'Albe Laurenz'" , References: <008101cd2916$1c023b20$5406b160$@com> <008001cd29db$ab24ba60$016e2f20$@com> In-Reply-To: Subject: Re: Very long " in transaction" query Date: Fri, 4 May 2012 17:02:27 +0530 Organization: Zoniac Software Private Limited Message-ID: <008a01cd29e9$975f0cc0$c61d2640$@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: Ac0pFhRfqWvBF5BbRGy7dyqTUWSSygAHxzPgAClwfOAAAp0MMAAAdRSQ Content-Language: en-us X-Lux-Comment: Message q44BXlju020114 sent by user #22393 X-Pg-Spam-Score: -2.6 (--) X-Archive-Number: 201205/20 X-Sequence-Number: 39509 > Then you need to identify the web server process/thread that has > client_port open and fix the problem there. If you get that process > to close the transaction or terminate, your problem is solved. > You can also terminate a database session from the server with > the pg_terminate_backend function. Thanks for letting me know the existence of "pg_terminate_backend(pid int)" function. Unfortunately, this is available only from v8.4 onwards. We're running v8.2.22. > The interesting thing to know would be where in your web application > a transaction got left open, so that it does not happen again. Sure, we too are hunting out for the same.