From: | Daniel Gustafsson <daniel(at)yesql(dot)se> |
---|---|
To: | Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com> |
Cc: | Florents Tselai <florents(dot)tselai(at)gmail(dot)com>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, "David E(dot) Wheeler" <david(at)justatheory(dot)com>, Aleksander Alekseev <aleksander(at)tigerdata(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Cary Huang <cary(dot)huang(at)highgo(dot)ca>, Przemysław Sztoch <przemyslaw(at)sztoch(dot)pl> |
Subject: | Re: encode/decode support for base64url |
Date: | 2025-09-19 07:39:08 |
Message-ID: | 2414DC55-0969-4458-8806-AE76BA49642D@yesql.se |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
> On 19 Sep 2025, at 08:56, Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com> wrote:
>> On Sep 19, 2025, at 14:45, Florents Tselai <florents(dot)tselai(at)gmail(dot)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 the link.
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
From | Date | Subject | |
---|---|---|---|
Next Message | 赵庭海 (庭章) | 2025-09-19 07:40:07 | Unnecessary calculations in Execproject |
Previous Message | Peter Eisentraut | 2025-09-19 07:37:46 | Re: _CRT_glob stuff |