Re: Error message style guide, take 2 - Mailing list pgsql-hackers

From Joe Conway
Subject Re: Error message style guide, take 2
Date
Msg-id 3EC50598.4020908@joeconway.com
Whole thread Raw
In response to Re: Error message style guide, take 2  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane wrote:
> Not sure ... feel free to make a proposal.  I had been planning to add
> function(s) to libpq to allow individual error fields to be extracted,
> but you are right that there'll need to be some way to customize the
> behavior of PQerrorMessage() as well.

What about a new connection string keyword that controls how much detail 
is included in PQerrorMessage() for the current session? Maybe 
message_verbosity as a level something like:

0 - no message text (not sure if this makes sense)
1 - short message only
2 - short plus detailed
3 - short plus detailed plus hint
4 - ?
5 - all details (short, detailed, hint, file, line, function name, etc)

Or perhaps better would be a new GUC variable?

> Perhaps we could put in some hack to vary the logging level depending
> on whether we are in postmaster start, postmaster run, backend start,
> backend run state.  Not sure though.  Any ideas?

Seems reasonable to have distinct postmaster_log_min_messages from 
backend_log_min_messages. And in similar fashion, 
postmaster_message_verbosity and backend_message_verbosity. Then use the 
verbosity setting to determine what text is actually logged.

Joe




pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Heads up: 7.3.3 this Wednesday
Next
From: Doug McNaught
Date:
Subject: Re: System triggers