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

From Tom Lane
Subject Re: [WIP] plpgsql is not translate-aware
Date
Msg-id 1349.1223508083@sss.pgh.pa.us
Whole thread Raw
In response to Re: [WIP] plpgsql is not translate-aware  (Alvaro Herrera <alvherre@commandprompt.com>)
Responses Re: [WIP] plpgsql is not translate-aware
List pgsql-hackers
Alvaro Herrera <alvherre@commandprompt.com> writes:
> Tom Lane wrote:
>> --- this looks like it could result in passing a NULL to dgettext,
>> somewhere along the line.  Probably safer to pass "postgres".

> Hmm, I was trusting that dgettext is documented to accept a NULL as
> meaning "use the domain previously set with textdomain", but then it is 
> possible that elog() will be called before textdomain is set, so you
> might be right.  Fixed in this new version.

Another way, which would save some amount of string constant space,
is to have both elog_finish and the ereport macro pass NULL, and let
errstart insert the default:

> +     edata->domain = domain ? domain : "postgres";

Otherwise we'll have at least one copy of "postgres" per backend .o
file ...
        regards, tom lane


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: [WIP] plpgsql is not translate-aware
Next
From: Kris Jurka
Date:
Subject: Fixes for psql describeOneTableDetails