Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id D84D364FCB1 for ; Mon, 17 Nov 2008 10:58:55 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 75467-08 for ; Mon, 17 Nov 2008 10:58:48 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from lists.commandprompt.com (host-159.commandprompt.net [207.173.203.159]) by mail.postgresql.org (Postfix) with ESMTP id D0D2164FC5C for ; Mon, 17 Nov 2008 10:58:48 -0400 (AST) Received: from perhan.alvh.no-ip.org (200-126-106-210.bk7-dsl.surnet.cl [200.126.106.210]) (authenticated bits=0) by lists.commandprompt.com (8.13.8/8.13.8) with ESMTP id mAHF3DJe002060 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 17 Nov 2008 07:03:16 -0800 Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 30B9B47CC0; Mon, 17 Nov 2008 11:58:37 -0300 (CLST) Date: Mon, 17 Nov 2008 11:58:37 -0300 From: Alvaro Herrera To: Ben Webber Cc: pgsql-admin@postgresql.org, Alexander Stanier Subject: Re: Change in logging behaviour between 8.1 and 8.2 Message-ID: <20081117145837.GG4291@alvh.no-ip.org> References: <4901E4ED.7090301@egsgroup.com> <6092.1224892561@sss.pgh.pa.us> <49217587.4030709@egsgroup.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <49217587.4030709@egsgroup.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0 (lists.commandprompt.com [207.173.203.159]); Mon, 17 Nov 2008 07:03:16 -0800 (PST) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200811/87 X-Sequence-Number: 30741 Ben Webber wrote: > Hi, > > I wrote a shell script to find the duration and the related statement in the log file and place them one after the other if the duration is over a specified time like this:- > > 2008-10-31 02:00:49 GMT [23683] [mp_live] LOG: statement: CLUSTER; > 2008-10-31 02:04:42 GMT [23683] [mp_live] LOG: duration: 232783.684 ms I wonder if you'd benefit from doing CSV logs and then storing them into a table. Querying using SQL is probably going to be easier (and more robust -- it'd work even with embedded newlines etc). -- Alvaro Herrera http://www.CommandPrompt.com/ The PostgreSQL Company - Command Prompt, Inc.