Re: plpgsql is not translate-aware - Mailing list pgsql-hackers

From Tom Lane
Subject Re: plpgsql is not translate-aware
Date
Msg-id 17581.1221532833@sss.pgh.pa.us
Whole thread Raw
In response to Re: plpgsql is not translate-aware  (Alvaro Herrera <alvherre@commandprompt.com>)
Responses Re: [WIP] plpgsql is not translate-aware  (Alvaro Herrera <alvherre@commandprompt.com>)
List pgsql-hackers
Alvaro Herrera <alvherre@commandprompt.com> writes:
> Tom Lane wrote:
>> Can't we give it its own text domain?  It seems fundamentally wrong
>> for a plug-in language to require core support for its messages.

> Another idea would be to redefine errmsg() and friends within the
> plpgsql sources, but that seems worse because every other library will
> need to do the same.

> Refinement of the previous idea: maybe we can add a compiler flag, to be
> set in Makefiles, that defines the domain and passes it down to
> EVALUATE_MESSAGE.

It seems like something like that could work.  I'd be inclined to change
the ereport() macro itself, not errmsg/errdetail/etc.  The domain name
could be passed in at ereport and then used when evaluating the
messages.

A possible problem is that some places use _() (ie, gettext) directly
instead of leaving it to the elog.c code to apply translation.  But I
suppose we might be able to redefine _() too.
        regards, tom lane


pgsql-hackers by date:

Previous
From: ITAGAKI Takahiro
Date:
Subject: Re: NDirectFileRead and Write
Next
From: Greg Smith
Date:
Subject: Add default_val to pg_settings