Re: [PATCH] Filter error log statements by sqlstate

From: Oskari Saarenmaa <os(at)ohmu(dot)fi>
To: Jeevan Chalke <jeevan(dot)chalke(at)enterprisedb(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] Filter error log statements by sqlstate
Date: 2014-01-13 11:00:01
Message-ID: 52D3C731.1050803@ohmu.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 13/01/14 10:26, Jeevan Chalke wrote:
> 1. Documentation is missing and thus becomes difficult to understand what
> exactly you are trying to do. Or in other words, user will be uncertain
> about using it more efficiently.

I figured I'd write documentation for this if it looks like a useful
feature which would be accepted for 9.4, but I guess it would've helped
to have a bit better description of this for the initial submission as well.

> 2. Some more comments required. At each new function and specifically at
> get_sqlstate_error_level().

Just after I submitted the patch I noticed that I had a placeholder for
comment about that function but never wrote the actual comment, sorry
about that.

> 3. Please add test-case if possible.

Sure.

> 4. Some code part does not comply with PostgreSQL indentation style. (Can be
> ignored as it will pass through pg_indent, but better fix it).

I'll try to fix this for v2.

> 5. You have used ""XX000:warning," string to get maximum possible length of
> the valid sqlstate:level identifier. It's perfect, but small explanation
> about that will be good there. Also in future if we have any other error level
> which exceeds this, we need changes here too. Right ?

Good point, I'll address this in v2.

> I will look into this further. But please have your attention on above
> points.

Thanks for the review!

/ Oskari

> On Fri, Jan 10, 2014 at 12:56 AM, Oskari Saarenmaa <os(at)ohmu(dot)fi>
> wrote:
> > Allow the default log_min_error_statement to be overridden per
> > sqlstate to make it possible to filter out some error types while
> > maintaining a low log_min_error_statement or enable logging for some
> > error types when the default is to not log anything.
> >
> > I've tried to do something like this using rsyslog filters, but
> > that's pretty awkward and doesn't work at all when the statement is
> > split to multiple syslog messages.
> >
> > https://github.com/saaros/postgres/compare/log-by-sqlstate

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2014-01-13 11:16:15 Re: [BUG] Archive recovery failure on 9.3+.
Previous Message Dean Rasheed 2014-01-13 10:33:16 Re: WIP patch (v2) for updatable security barrier views