Re: Upgrading the backend's error-message infrastructure

From: Neil Conway <neilc(at)samurai(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, pgsql-interfaces(at)postgreSQL(dot)org
Subject: Re: Upgrading the backend's error-message infrastructure
Date: 2003-03-13 21:39:31
Message-ID: 1047591570.356.1854.camel@tokyo
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-interfaces

On Thu, 2003-03-13 at 15:51, Tom Lane wrote:
> After digging through our many past discussions of what to do with error
> messages, I have put together the following first-cut proposal.

Great work, Tom!

While we're effectively changing every elog call site in the backend,
would it also be a good idea to adopt a standard for the format of error
messages? (e.g. capitalization, grammar, etc.)

> extern int errmsg_internal(const char *fmt, ...);
>
> Like errmsg() except that the first parameter is not subject to
> gettext-ification. My thought is that this would be used for internal
> can't-happen conditions; there's no need to make translators labor over
> translating stuff like "eval_const_expressions: unexpected boolop %d",
> nor even to make them think about whether they need to.

If we wanted to get fancy, we could make use of the glibc ability to
generate a back trace programatically:

http://www.gnu.org/manual/glibc-2.2.5/html_node/Backtraces.html#Backtraces

> In gcc-compiled
> backends, the function name will be provided automatically by errstart,
> but there will be some places where we need the name to be available even
> in a non-gcc build.

To be honest, I'd be sceptical whether there are enough platforms
without *either* gcc or a C99 compiler that it's worthwhile worrying
about them that much (all that is at stake is some backward
compatibility, anyway).

Cheers,

Neil

--
Neil Conway <neilc(at)samurai(dot)com> || PGP Key ID: DB3C29FC

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jean-Luc Lachance 2003-03-13 21:42:45 Re: Upgrading the backend's error-message infrastructure
Previous Message Larry Rosenman 2003-03-13 21:32:44 Re: Upgrading the backend's error-message infrastructure

Browse pgsql-interfaces by date

  From Date Subject
Next Message Jean-Luc Lachance 2003-03-13 21:42:45 Re: Upgrading the backend's error-message infrastructure
Previous Message Larry Rosenman 2003-03-13 21:32:44 Re: Upgrading the backend's error-message infrastructure