Re: encode/decode support for base64url - Mailing list pgsql-hackers

From Daniel Gustafsson
Subject Re: encode/decode support for base64url
Date
Msg-id 2414DC55-0969-4458-8806-AE76BA49642D@yesql.se
Whole thread Raw
In response to Re: encode/decode support for base64url  (Chao Li <li.evan.chao@gmail.com>)
List pgsql-hackers
> On 19 Sep 2025, at 08:56, Chao Li <li.evan.chao@gmail.com> wrote:
>> On Sep 19, 2025, at 14:45, Florents Tselai <florents.tselai@gmail.com> wrote:

>>> This is a normal usage that injects sub-strings based on condition. However, PG doesn’t like that, see here:
https://www.postgresql.org/docs/devel/nls-programmer.html#NLS-GUIDELINES 
>>
>> Well, that’s a very interesting catch.
>> I’ll let a comitter confirm & advise.
>
> I got to know this because once I reviewed a Tom Lane’s patch, it had the similarly situation, but Tom wrote code
like:
>
> ```
> If (something)
>     Ereport(“function xxx”)
> Else
>     Ereport(“procedure xxx”)
> ```
>
> I raised a comment to suggest avoid duplicate code in the way like your code do, and I got a response with “no” and
thelink. 

Tom is right (unsurprisingly) here, since "function" and "procedure" are terms
which are translated and depending on which is used it may change the sentence
structure in the target language.

In this case we inject a name which isn't to be translated, and that will
instead help the translator since they otherwise need to translate two strings
instead of just one (and they can move the %s to position the injected name
into the right place according to grammar rules).

--
Daniel Gustafsson




pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: _CRT_glob stuff
Next
From: "赵庭海(庭章)"
Date:
Subject: Unnecessary calculations in Execproject