pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Neil Conway <neilc@samurai.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Cc: pgsql-interfaces@postgreSQL.org
Subject: Re: Upgrading the backend's error-message infrastructure
Date: 13 Mar 2003 16:39:31 -0500
Message-ID: <1047591570.356.1854.camel@tokyo> (raw)
In-Reply-To: <9168.1047588660@sss.pgh.pa.us>
References: <9168.1047588660@sss.pgh.pa.us>

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@samurai.com> || PGP Key ID: DB3C29FC






view thread (32+ messages)  latest in thread

Message-ID: <1047591570.356.1854.camel@tokyo>
Permalink:  ../1047591570.356.1854.camel@tokyo/
Also on:    postgresql.org/message-id/1047591570.356.1854.camel@tokyo

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: neilc@samurai.com, tgl@sss.pgh.pa.us, pgsql-hackers@postgresql.org
  Subject: Re: Upgrading the backend's error-message infrastructure
  In-Reply-To: <1047591570.356.1854.camel@tokyo>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox