X-Original-To: pgsql-admin-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id E0BC09FA50F for ; Thu, 17 Aug 2006 11:31:12 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 28396-05 for ; Thu, 17 Aug 2006 11:31:02 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from exchange.g2switchworks.com (mail.g2switchworks.com [63.87.162.25]) by postgresql.org (Postfix) with ESMTP id E6F9D9FA0B9 for ; Thu, 17 Aug 2006 11:31:02 -0300 (ADT) Received: from 10.10.1.37 ([10.10.1.37]) by exchange.g2switchworks.com ([10.10.1.2]) with Microsoft Exchange Server HTTP-DAV ; Thu, 17 Aug 2006 14:30:59 +0000 Received: from state.g2switchworks.com by mail.g2switchworks.com; 17 Aug 2006 09:30:59 -0500 Subject: Re: Monitoring error messages From: Scott Marlowe To: robin.c.smith@bt.com Cc: pgsql-admin@postgresql.org In-Reply-To: References: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Message-Id: <1155825059.20252.200.camel@state.g2switchworks.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) Date: Thu, 17 Aug 2006 09:30:59 -0500 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.088 tagged_above=0 required=5 tests=AWL, SPF_PASS, UNPARSEABLE_RELAY X-Spam-Level: X-Archive-Number: 200608/203 X-Sequence-Number: 22746 On Thu, 2006-08-17 at 08:33, robin.c.smith@bt.com wrote: > I am testing the monitoring of the postgresql 8.1.4 - I have found > that I would like to suppress some things from the log >=20 > For example if I type some random rubbish into the database instead of > select=E2=80=A6. I get an error message logged into the server logfile li= ke:- >=20 > 2006-08-17 14:19:00.965 BST 10109 # ERROR: syntax error at or near > "kshdfkjh" at character 1 > 2006-08-17 14:19:00.965 BST 10109 # STATEMENT: kshdfkjh; >=20 > More importantly I have deleted a file from the database tables and > when I try to query data in the file I get the error:- >=20 > 2006-08-17 14:14:30.922 BST 10085 # ERROR: could not open relation > 1663/16384/16385: No such file or directory > 2006-08-17 14:14:30.922 BST 10085 # STATEMENT: select * from > rs_vacuum; >=20 > These are both logged as ERROR: which is easy to check for with > automatic monitoring. However I wouldn't want to be called out to fix > a non-existent error where someone has typed in some nonsense. Is it > easy to suppress the syntax errors so that the real database errors > are obvious? I've had the same issue in the past. A simple fix is to pipe the output of your grep into a series of "grep -v" statements. For instance, this line is how we used to check for errors in our production logs: b=3D`grep -c PANIC $e`; Just add the grep -v in there: b=3D`grep -c PANIC $e|grep -vi syntax`; and now syntax errors aren't reported.