Re: Internationalized error messages

From: Andrew Evans <andrew(at)zembu(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Internationalized error messages
Date: 2001-03-09 19:43:20
Message-ID: 20010309114320.C12977@zembu.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> > Let's say "type mismatch error", code 2200G acc. to SQL. At one place in
> > the source you write
> > elog(ERROR, "2200G", "type mismatch in CASE expression (%s vs %s)", ...);

Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> spake:
> I object to writing "2200G" however, because that has no mnemonic value
> whatever, and is much too easy to get wrong. How about
>
> elog(ERROR, ERR_TYPE_MISMATCH, "type mismatch in argument %d of function %s,
> expected %s, got %s", ...);
>
> where ERR_TYPE_MISMATCH is #defined as "2200G" someplace? Or for that
> matter #defined as "TYPE_MISMATCH"? Content-free numeric codes are no
> fun to use on the client side either...

This is one thing I think VMS does well. All error messages are a
composite of the subsystem where they originated, the severity of the
error, and the actual error itself. Internally this is stored in a
32-bit word. It's been a long time, so I don't recall how many bits
they allocated for each component. The human-readable representation
looks like "<subsystem>-<severity>-<error>".

--
Andrew Evans

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Myers 2001-03-09 19:49:20 Re: Internationalized error messages
Previous Message Tom Lane 2001-03-09 19:31:16 Re: porting question: funky uid names?