Skip site navigation (1) Skip section navigation (2)

SQL state in log_line_prefix

From: Guillaume Smet <guillaume(dot)smet(at)gmail(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: SQL state in log_line_prefix
Date: 2009-05-10 12:32:26
Message-ID: 1d4e0c10905100532i6c6c1705o4aa4e3c5168c4bca@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackers
Hi -hackers,

A customer of us recently wanted to separate user errors from system
errors as different teams are working on these 2 types of errors and
while they might want to ignore user errors (bad-written SQL queries
and so on), they want to be sure system errors are analyzed carefully.

A good way to differentiate the 2 types of errors is to use the SQL state.

Currently, the only way to have the SQL state in the standard log file
is to do verbose logging which is, well..., verbose.

I attached a patch which allows to add the SQL state code into the
log_line_prefix. I used %e (as in error) as %s is already used.

Any comment?

-- 
Guillaume

Attachment: postgresql-log_line_prefix-sql_state.diff
Description: text/x-patch (7.1 KB)

Responses

pgsql-hackers by date

Next:From: Guillaume SmetDate: 2009-05-10 12:52:58
Subject: Re: SQL state in log_line_prefix
Previous:From: Khee ChinDate: 2009-05-10 05:24:24
Subject: Re: Show method of index

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group