Re: Error message style guide, take 2

From: Joe Conway <mail(at)joeconway(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Error message style guide, take 2
Date: 2003-05-16 15:36:56
Message-ID: 3EC50598.4020908@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Ricardo Ryoiti S. Junior 2003-05-16 16:43:04 Re: [Fwd: [HACKERS] Heads up: 7.3.3 this Wednesday]
Previous Message Tom Lane 2003-05-16 15:25:29 Re: Heads up: 7.3.3 this Wednesday