Re: Internationalized error messages

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Internationalized error messages
Date: 2001-03-09 16:00:53
Message-ID: 6895.984153653@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> That's exactly what I was trying to avoid. You'd still be allowed to
> choose the error message text freely, but client programs will be able to
> make sense of them by looking at the code only, as opposed to parsing the
> message text. I'm trying to avoid making the message text to be computed
> from the error code, because that obscures the source code.

I guess I don't understand what you have in mind, because this seems
self-contradictory. If "client programs can look at the code only",
then how can the error message text be chosen independently of the code?

>> Surely we do not expect gettext to start with 'Attribute "foo" not
>> found' and distinguish fixed from variable parts of that string?

> Sure we do.

How does that work exactly? You're assuming an extremely intelligent
localization mechanism, I guess, which I was not. I think it makes more
sense to work a little harder in the backend to avoid requiring AI
software in every frontend.

>> MESSAGE: Attribute or table name not known within context of query

> How's that different from ERROR:?

Sorry, I meant that as an example of the "secondary message string", but
it's a pretty lame example...

> The general problem here is also that this would introduce a client
> incompatibility. Older clients that do not expect this amount of detail
> will print all this garbage to the screen?

Yes, if we send it to them. It would make sense to control the amount
of detail presented via some option (a GUC variable, probably). For
backwards compatibility reasons we'd want the default to correspond to
roughly the existing amount of detail.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2001-03-09 16:17:12 Re: 7.0.3 Bitset dumping
Previous Message Peter Eisentraut 2001-03-09 15:57:18 Re: Internationalized error messages