pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Scott Marlowe <smarlowe@g2switchworks.com>
To: robin.c.smith@bt.com
Cc: pgsql-admin@postgresql.org
Subject: Re: Monitoring error messages
Date: Thu, 17 Aug 2006 09:30:59 -0500
Message-ID: <1155825059.20252.200.camel@state.g2switchworks.com> (raw)
In-Reply-To: <D012B9600FFB984AB18C0D53C475A4A0B2BEB2@E03MVZ3-UKDY.domain1.systemhost.net>
References: <D012B9600FFB984AB18C0D53C475A4A0B2BEB2@E03MVZ3-UKDY.domain1.systemhost.net>

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
> 
> For example if I type some random rubbish into the database instead of
> select…. I get an error message logged into the server logfile like:-
> 
> 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;
> 
> 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:-
> 
> 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;
> 
> 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=`grep -c PANIC $e`;

Just add the grep -v in there:

b=`grep -c PANIC $e|grep -vi syntax`;

and now syntax errors aren't reported.



view thread (3+ messages)  latest in thread

Message-ID: <1155825059.20252.200.camel@state.g2switchworks.com>
Permalink:  ../1155825059.20252.200.camel@state.g2switchworks.com/
Also on:    postgresql.org/message-id/1155825059.20252.200.camel@state.g2switchworks.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: smarlowe@g2switchworks.com, robin.c.smith@bt.com
  Subject: Re: Monitoring error messages
  In-Reply-To: <1155825059.20252.200.camel@state.g2switchworks.com>
  References: <D012B9600FFB984AB18C0D53C475A4A0B2BEB2@E03MVZ3-UKDY.domain1.systemhost.net> <1155825059.20252.200.camel@state.g2switchworks.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox